def __init__(self, host: str = 'localhost', port: int = 8125, prefix: str = '', maxudpsize: Any = _sentinel) -> None:
'''
Create a new client.
:param host: Host of the statsd server.
:param port: Port of the statsd server, 8125 by default.
:param prefix: String that will be prefixed to any stat description.
:param maxudpsize: Ignored in this implementation.
'''
self._prefix = prefix + '.' if prefix else ''
self._server_addr = (socket.gethostbyname(host), port)
self._queue = cystatsd.MetricCollector()
self._queue_cv = threading.Condition()
if maxudpsize is not self._sentinel:
warnings.warn('Fastatsd client doesn\'t support maxudpsize')
self._start_sender_thread()
评论列表
文章目录