Skip to main content

A library for tracing code into the chrome Event Trace format

Project description

Generating Data:

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).

Viewing Data:

Visit chrome://tracing

Load JSON file

Screenshot

Format Spec:

Google Doc

Uses the JSON Array Format because that's the one which can be appended to from multiple threads

Packaging Howto:

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/*

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

eventtracer-py-0.0.2.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

eventtracer_py-0.0.2-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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