Install library
python3 -m pip install eventtracer-py
Create tracer
from eventtracer import EventTracer
et = EventTracer("myeventlog.json")
Procedural API
et.begin("Eating Cake")
...
et.end()
Decorator API
@et.decorator
def foo():
...
foo()
Context Manager API
with et.context("doing stuff"):
...
Profiler API
et.set_profile(True)
If filename isn't specified, then data will be buffered
in-memory (et.buffer
) and can be written to disk in
one go with et.flush(filename)
.
Visit chrome://tracing
Load JSON file
Uses the JSON Array Format because that's the one which can be appended to from multiple threads
Because I forget every time I need to do this...
vim setup.py # change version
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*