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.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

python_statsd-1.4-py2.6.egg (12.0 kB view details)

Uploaded Source

python-statsd-1.4.linux-i686.tar.gz (8.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for python-statsd-1.4.tar.gz
Algorithm Hash digest
SHA256 62be016ed161f86abc455da6dcd0b662cfd33b7ab9c6f00f9d74617952d37d06
MD5 6711e9f1de0be58116a6c75c7a22b587
BLAKE2b-256 29245ef376b6db70660fa998661afdfef9ee393ac76906a1f1250d92af908de1

See more details on using hashes here.

File details

Details for the file python_statsd-1.4-py2.6.egg.

File metadata

File hashes

Hashes for python_statsd-1.4-py2.6.egg
Algorithm Hash digest
SHA256 60820a69f8db177640711353123a4e848628f370c37977776e4c22b12505abf9
MD5 196efc68c8b5ad8563ef5cc51c1c4e69
BLAKE2b-256 8cdce655982c7c90bfa7ce7bed08fdbc758a8a871bc0a4daa8c17115f52aa2c3

See more details on using hashes here.

File details

Details for the file python-statsd-1.4.linux-i686.tar.gz.

File metadata

File hashes

Hashes for python-statsd-1.4.linux-i686.tar.gz
Algorithm Hash digest
SHA256 091e246bf87eddec5481714ae89b4f9ad5a1a7dc82614e2625cf375fae0b6e17
MD5 ff60ff3b6a20bbbac4df0a528c42a82a
BLAKE2b-256 f591d9f35d56ada6a3e2f54495fd94b828db008acab5779f383f5b6ca5ee53cd

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