Beispiel #1
0
    async def test_mutli_msg(self,
                             dog_statsd_client: aio_statsd.DogStatsdClient,
                             udp_server):
        metric = aio_statsd.DogStatsdProtocol()
        metric.gauge("test2.key", 1)
        metric.increment("test2.key", 1)
        dog_statsd_client.send_dog_statsd(metric)

        for result in [b"test2.key:1|g", b"test2.key:1|c"]:
            assert await udp_server.get() == result
Beispiel #2
0
    async def test_namespace(self,
                             dog_statsd_client: aio_statsd.DogStatsdClient,
                             udp_server):
        metric = aio_statsd.DogStatsdProtocol(prefix="so1n_test")
        metric.gauge("test2.key", 1)
        metric.increment("test2.key", 1)
        dog_statsd_client.send_dog_statsd(metric)

        for result in [b"so1n_test.test2.key:1|g", b"so1n_test.test2.key:1|c"]:
            assert await udp_server.get() == result