client.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:fastatsd 作者: qntln 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号