# Runtime Stats for Functions
Python decorator function to track runtime stats on function calls
# Example
```
@runtime_stats()
def self_mult(n):
sleep(0.2)
return n*n
print(self_mult(10)) # => 100
print(self_mult(7)) # => 49
print(self_mult.get_func_runtime_stats()) # => {'total_time': 401.668, 'avg': 200.834, 'func_uid': 4302206808, 'func_name': 'self_mult', 'min': 200.445, 'max': 201.223, 'total_calls': 2}
```
# Usage
Decorate a function with `@runtime_stats()` to keep track of that function's runtime (min, max, avg, total_calls, and total_time)
# Compatibility
Tested compatible with Py2.7 and Py3, but this code is provided as is with no warranty or guarantee, implied or explicit.
# More Information
Please see my blog post here: http://garrens.com/blog/2016/10/21/runtime-stats-for-functions-python-decorator/
Python decorator function to track runtime stats on function calls
# Example
```
@runtime_stats()
def self_mult(n):
sleep(0.2)
return n*n
print(self_mult(10)) # => 100
print(self_mult(7)) # => 49
print(self_mult.get_func_runtime_stats()) # => {'total_time': 401.668, 'avg': 200.834, 'func_uid': 4302206808, 'func_name': 'self_mult', 'min': 200.445, 'max': 201.223, 'total_calls': 2}
```
# Usage
Decorate a function with `@runtime_stats()` to keep track of that function's runtime (min, max, avg, total_calls, and total_time)
# Compatibility
Tested compatible with Py2.7 and Py3, but this code is provided as is with no warranty or guarantee, implied or explicit.
# More Information
Please see my blog post here: http://garrens.com/blog/2016/10/21/runtime-stats-for-functions-python-decorator/
Metadata
Release files for runtime-stats 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| runtime_stats-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
| runtime_stats-0.1.2-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 7.3 kB
Release files / runtime_stats-0.1.2-py3-none-any.whl
| Download URL | runtime_stats-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
798747f548b57b0b3a5778620a1f5dc4e913f70be626b26a0816274139b8190c
|
|
BLAKE2b-256 checksum How to use checksums |
9332288fff511445a5df7c693dd53178a5f61ac99bdacdbac2e63794627ec439
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / runtime_stats-0.1.2-py2-none-any.whl
| Download URL | runtime_stats-0.1.2-py2-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
59e17a722c2e717202ecc51340855e62b847650025864536562a111675f37ef3
|
|
BLAKE2b-256 checksum How to use checksums |
8a33e66f688e3f6006b02d3381e107958d91b38201605e8bc7cbce1b9713077c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |