Skip to main content

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


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

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

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.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page