Skip to main content

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']

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stat_tracker-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file stat_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: stat_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for stat_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c91b9e62ce221eb02350c0c897ebe393d60c17e9264b1510513759b10f21d550
MD5 dbbca218cff005b007b4874823d0acb8
BLAKE2b-256 ceff89e8fe5dcb6d7adc411b1486c07fd679b0fcc9c33706e9906209f1c0a765

See more details on using hashes here.

File details

Details for the file stat_tracker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stat_tracker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for stat_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94f6546a55ad0dc3ddaad9a0acf8beb1b2f9d29b73df0acd59c44876c5dde5b3
MD5 99eec53f0b495d5293a5025e11fcb560
BLAKE2b-256 2187c629476ff3ee451766d6883be9f395ccf38bbabe84b4a6c9dc4665c84765

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page