def __init__(self, host='localhost', port=8125, max_buffer_size=50, namespace=None,
                 constant_tags=None, use_ms=False):
        """
        Initialize a DogStatsd object.

        >>> statsd = DogStatsd()

        :param host: the host of the DogStatsd server.
        :type host: string

        :param port: the port of the DogStatsd server.
        :type port: integer

        :param max_buffer_size: Maximum number of metrics to buffer before sending to the server
        if sending metrics in batch
        :type max_buffer_size: integer

        :param namepace: Namespace to prefix all metric names
        :type namepace: string

        :param constant_tags: Tags to attach to all metrics
        :type constant_tags: list of strings

        :param use_ms: Report timed values in milliseconds instead of seconds (default False)
        :type use_ms: boolean

        :envvar DATADOG_TAGS: Tags to attach to every metric reported by dogstatsd client
        :type constant_tags: list of strings
        """
        self.host = host
        self.port = int(port)
        self.socket = None
        self.max_buffer_size = max_buffer_size
        self._send = self._send_to_server
        self.encoding = 'utf-8'
        env_tags = [tag for tag in os.environ.get('DATADOG_TAGS', '').split(',') if tag]
        if constant_tags is None:
            constant_tags = []
        self.constant_tags = constant_tags + env_tags
        self.namespace = namespace
        self.use_ms = use_ms
dataset/ETHPy150Open DataDog/datadogpy/datadog/dogstatsd/base.py/DogStatsd.__init__/original