Skip to main content

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

Project details


Download files

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

Source Distribution

statsdmock-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file statsdmock-0.0.1.tar.gz.

File metadata

  • Download URL: statsdmock-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for statsdmock-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3d26b25a045fbd00031601f278ec2741c827402ec1d086fc7977f792da651370
MD5 60a56e7c6b178f391ad28c1f95ef1a3b
BLAKE2b-256 7f259f2db9faa4929d7c361b81ef538a456a59eee7885e0daa1355d1d64882c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page