A Python statsd client
statsd is a friendly front-end to Graphite. This is a Python client for the statsd daemon.
To use:
>>> import statsd
>>> c = statsd.StatsClient('localhost', 8125)
>>> c.incr('foo') # Increment the 'foo' counter.
>>> c.timing('stats.timed', 320) # Record a 320ms 'stats.timed'.
In Django
If you’re lucky enough to be using statsd in Django, you can configure a default client in your settings module with two values. The defaults are:
STATSD_HOST = 'localhost' STATSD_PORT = 8125
Then instead of instantiating a new client every time, you can just grab:
>>> from statsd import statsd
>>> statsd.incr('foo')
Context Manager
You can use a StatsClient instance as a context manager to easily time sections of code with the timer() method:
>>> from statsd import statsd
>>> with statsd.timer('bar'):
... func()
... func()
When the managed block exits, the client will automatically send the time it took to statsd.
Metadata
Release files for statsd 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| statsd-0.1.1.tar.gz | 3.4 kB | Without provenance | Details for statsd-0.1.1.tar.gz |
Release files / statsd-0.1.1.tar.gz
| Download URL | statsd-0.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4670a5237c4fc86b74bc2035403629188d8dc50adb850edfa3cf407bb0b21bb
|
|
BLAKE2b-256 checksum How to use checksums |
14f77d19ab9e5a17a364ad0cfe01feee369fe1d6f111e4fba820c9f92aaf688f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for statsd 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.