Skip to main content
Help us improve Python packaging – donate today!

statsd mock server based on gevent

Project Description

https://travis-ci.org/tarzan0820/statsd-mock.png?branch=master

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

Installation

$ 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 Release notifications

This version
History Node

0.0.3

History Node

0.0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
statsdmock-0.0.3.tar.gz (3.7 kB) Copy SHA256 hash SHA256 Source None Jan 4, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page