Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

statsd mock server based on gevent

Project Description

Based entirely on - studio-ousia/gevent-statsd-moc with python-statsd dependency changed to pystatsd and gevent.server.DatagramServer used to handle the server portion


$ pip install mock-statd

Basic Usage

In this sample we use pystatsd for client library

>>> from statsdmock import StatsdMockServer
>>> server = StatsdMockServer()
>>> server.start()
>>> import statsd
>>> c = statsd.StatsClient(prefix='bigtag')
>>> c.gauge('subtag', 10)
>>> server.wait('bigtag.subtag', n=1)
>>> data = list(server.metrics['bigtag.subtag'])
>>> assert data[0] == {'value': '10', 'type': 'gauge', 'rate': 1.0, 'timestamp': None}
>>> server.stop()
>>> del server

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(3.7 kB) Copy SHA256 Hash SHA256
Source Jan 4, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting