Skip to main content

statsd is a client for Etsy's node-js statsd server. A proxy for the Graphite stats collection and graphing server.

Project description

Introduction

statsd is a client for Etsy’s statsd server, a front end/proxy for the Graphite stats collection and graphing server.

Install

To install simply execute python setup.py install. If you want to run the tests first, run python setup.py nosetests

Usage

To get started real quick, just try something like this:

Basic Usage

Timers

>>> import statsd
>>>
>>> timer = statsd.Timer('MyApplication')
>>>
>>> timer.start()
>>> # do something here
>>> timer.stop('SomeTimer')

Counters

>>> import statsd
>>>
>>> counter = statsd.Counter('MyApplication')
>>> # do something here
>>> counter += 1

Advanced Usage

>>> import statsd
>>>
>>> # Open a connection to `server` on port `1234` with a `50%` sample rate
>>> statsd_connection = statsd.Connection(
...     name='server',
...     port=1234,
...     sample_rate=0.5,
... )
>>>
>>> # Create a client for this application
>>> statsd_client = statsd.Client(__name__, statsd_connection)
>>>
>>> class SomeClass(object):
...     def __init__(self):
...         # Create a client specific for this class
...         self.statsd_client = statsd_client.get_client(
...             self.__class__.__name__)
...
...     def do_something(self):
...         # Create a `timer` client
...         timer = self.statsd_client.get_client(class_=statsd.Timer)
...
...         # start the measurement
...         timer.start()
...
...         # do something
...         timer.interval('intermediate_value')
...
...         # do something else
...         timer.stop('total')

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

python-statsd-1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

python_statsd-1.1-py2.5.egg (11.7 kB view details)

Uploaded Source

File details

Details for the file python-statsd-1.1.tar.gz.

File metadata

  • Download URL: python-statsd-1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-statsd-1.1.tar.gz
Algorithm Hash digest
SHA256 702ef02bbc276fa5d8556f759d4942c468985067ba4f25a94bb1880051059e17
MD5 acd34ae4e2df0aca230ba0188befaac6
BLAKE2b-256 7e89134198b0e89387945e4a73abebea690a9e94410a9f30b37e1eabf2b34f4b

See more details on using hashes here.

File details

Details for the file python_statsd-1.1-py2.5.egg.

File metadata

File hashes

Hashes for python_statsd-1.1-py2.5.egg
Algorithm Hash digest
SHA256 77d81124dcc0751a9cb2025357e21823ab2020a618b63e35bbb9f3bc3bd4bc78
MD5 5de61864901d258f86c1c9126fa752b0
BLAKE2b-256 3446784316a597f4000b9720aa9167c2f58da8584ee0feee9f98e4ae76657edc

See more details on using hashes here.

Supported by

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