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.
- Graphite
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
Release history Release notifications | RSS feed
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)
Built Distributions
python_statsd-1.4-py2.6.egg
(12.0 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62be016ed161f86abc455da6dcd0b662cfd33b7ab9c6f00f9d74617952d37d06 |
|
MD5 | 6711e9f1de0be58116a6c75c7a22b587 |
|
BLAKE2b-256 | 29245ef376b6db70660fa998661afdfef9ee393ac76906a1f1250d92af908de1 |
File details
Details for the file python_statsd-1.4-py2.6.egg
.
File metadata
- Download URL: python_statsd-1.4-py2.6.egg
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60820a69f8db177640711353123a4e848628f370c37977776e4c22b12505abf9 |
|
MD5 | 196efc68c8b5ad8563ef5cc51c1c4e69 |
|
BLAKE2b-256 | 8cdce655982c7c90bfa7ce7bed08fdbc758a8a871bc0a4daa8c17115f52aa2c3 |
File details
Details for the file python-statsd-1.4.linux-i686.tar.gz
.
File metadata
- Download URL: python-statsd-1.4.linux-i686.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091e246bf87eddec5481714ae89b4f9ad5a1a7dc82614e2625cf375fae0b6e17 |
|
MD5 | ff60ff3b6a20bbbac4df0a528c42a82a |
|
BLAKE2b-256 | f591d9f35d56ada6a3e2f54495fd94b828db008acab5779f383f5b6ca5ee53cd |