Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

statsdmock

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statsdmock

statsd mock server based on gevent

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

statsd-mock

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

Based entirely on - studio-ousia/gevent-statsd-moc <https://github.com/studio-ousia/gevent-statsd-mock>_ with python-statsd <https://github.com/WoLpH/python-statsd>_ dependency changed to pystatsd <https://github.com/jsocol/pystatsd>_ and gevent.server.DatagramServer used to handle the server portion

Installation

.. code-block:: bash

$ pip install mock-statd

Basic Usage

In this sample we use pystatsd <https://github.com/jsocol/pystatsd>_ for client library

.. code-block:: python

>>> 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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc