StopWatch - library for adding timers and tags in your code for performance monitoring
Project description
k3stopwatch
StopWatch - library for adding timers and tags in your code for performance monitoring
k3stopwatch is a component of pykit3 project: a python3 toolkit set.
StopWatch operates on a notion of "spans" which represent scopes of code for which we want to measure timing. Spans can be nested and placed inside loops for aggregation.
StopWatch requires a root scope which upon completion signifies the end of the round of measurements. On a server, you might use a single request as your root scope.
StopWatch produces two kinds of reports.
- Aggregated (see _reported_values).
- Non-aggregated or "tracing" (see _reported_traces).
Install
pip install k3stopwatch
Synopsis
import k3stopwatch
sw = k3stopwatch.StopWatch()
with sw.timer('rwoot'):
for i in range(50):
with sw.timer('inner_task'):
print("do_inner_task(i)")
Author
Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Copyright and License
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com
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
Built Distribution
Hashes for k3stopwatch-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b28854cc8ceb1055c1ed25a90c7a49a2417694e96d6cf8f9b2f632e19b1e57ed |
|
MD5 | 80bc91cb1e056183bda02b3b1428acbd |
|
BLAKE2b-256 | 172ce3a51066b9a425e7b86283963e04337d18d61814b287060911859dd66856 |