pystat - simple library for in-memory aggregation
CI status:
This library is a thin python wrapper around counter and timer implementation in https://raw.github.com/armon/statsite
Installing
pystat can be installed via pypi:
pip install pystat
Building
Get the source:
git clone https://github.com/blackwithwhite666/pystat.git
Compile extension:
python setup.py build_ext --inplace
Usage
Counter example:
from pystat import Counter counter = Counter() counter.add() assert 1 == int(counter) counter.add() assert 2 == int(counter) counter.add(5) assert 7 == int(counter) assert 3 == len(counter) assert 5.0 == counter.max assert 1.0 == counter.min assert 2.333.. == counter.mean assert 2.309.. == counter.stddev
Timer example:
from pystat import Timer timer = Timer() timer.add(1.0) assert 1 == int(timer) timer.add(1.0) assert 2 == int(timer) timer.add(5) assert 7 == int(timer) assert (0.5, 0.95, 0.99) == timer.quantiles assert 5.0 == timer.query(0.99) assert 1.0 == timer.query(0.5)
Running the test suite
Use Tox to run the test suite:
tox
Changelog
0.2.4
Add support for load and dump;
Check for overflow in __len__;
0.2.3
Support for fluent interface;
0.2.2
PlainCounter implementation;
0.2.1
Counter can take some iterable to constructor;
0.2.0
Add serialization support for Counter;
Add union support for Counter;
0.1.0 (initial release)
Prototype.
Metadata
Release files for pystat 0.2.4
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 |
|---|---|---|---|---|
| pystat-0.2.4.tar.gz | 80.9 kB | Without provenance | Details for pystat-0.2.4.tar.gz |
Release files / pystat-0.2.4.tar.gz
| Download URL | pystat-0.2.4.tar.gz |
|---|---|
| Size | 80.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c8864bfa2daf28e84cf537b26e4a434ee2edda29209819e563f7ad0f6f9aec2
|
|
BLAKE2b-256 checksum How to use checksums |
c6ca47ab9ddd69c208970c534c1c0c3f640d0f89df5f42ccfefb4685aa775294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pystat 0.2.4
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.