Local metrics and measurements
Project description
stat-tracker
stat-tracker
is a small utility library for short-term record-keeping, such as gathering local metrics inside a function .
Installation
pip install stat-tracker
Usage
stats = StatTracker()
with stats.time1:
sleep(0.05)
for _ in range(5):
stats.value1 += 1
for i in stats.loop1.count(range(10)):
pass
for i in stats('loop2').count(range(100)):
pass
stats.tags.append('a')
stats.tags.extend(['b', 'c'])
print(f'time {stats.time1}') # time 0.05
print(f'added {stats.value1}') # added 5
print(f'counted {stats.loop1}') # counted 10
print(f'counted {stats('loop2')}') # counted 100
print(f'gathered {stats.tags}') # gathered ['a', 'b', 'c']
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
stat_tracker-0.1.0.tar.gz
(32.8 kB
view hashes)
Built Distribution
Close
Hashes for stat_tracker-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f6546a55ad0dc3ddaad9a0acf8beb1b2f9d29b73df0acd59c44876c5dde5b3 |
|
MD5 | 99eec53f0b495d5293a5025e11fcb560 |
|
BLAKE2b-256 | 2187c629476ff3ee451766d6883be9f395ccf38bbabe84b4a6c9dc4665c84765 |