Track functions invocations
Project description
spoor
Track invocation of your functions and methods; display collected statistics for the invocations; export data gathered to external services.
$ pip install spoor
Usage
from spoor import Spoor
s = Spoor()
@s.track
def function(a: int, b: int):
return a + b
func(5, 10)
func(23, 42)
assert s.called(func)
assert s.call_count(func) == 2
Configuration
Option | Type | Default | Description |
---|---|---|---|
attach |
bool |
False |
Expose called /call_count attributes directly on a function/method object. |
distinct_instances |
bool |
False |
Separate metrics collection for each instance of a class. Has no effect if tracking only functions. |
disabled |
bool |
False |
Initialize as inactive and ignore metrics collection until enabled explicitly. Can be controlled via enable() /disable() methods later. |
Exporters
See also
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
spoor-0.3.4.tar.gz
(4.8 kB
view details)
Built Distribution
spoor-0.3.4-py3-none-any.whl
(5.3 kB
view details)
File details
Details for the file spoor-0.3.4.tar.gz
.
File metadata
- Download URL: spoor-0.3.4.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a6e88ea482c520eec5eb704ed5e85d6f1736bb2efd294a8c4b166e51ca5ac42 |
|
MD5 | ee534f9aed359b31d0957621b9d4443f |
|
BLAKE2b-256 | bee840844e1e3ef582188abea5b2262d3104092a97ac25acb3741c12eb3ad8a1 |
File details
Details for the file spoor-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: spoor-0.3.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d25840f3d2476c01e546f7501f687cb205640240424a3cc81fe3c76f60ba7ef |
|
MD5 | 720e00101e27e7a701a94caea941b509 |
|
BLAKE2b-256 | da897e70b94c14f4571ec12cd09d4b516af9eeb0b6f6914d33e1dbc03fa304ba |