A Python library for Chrome Trace Viewer files
Project description
chrometrace
A Python library for creating Chrome Trace Viewer files. The Chrome Trace Viewer can be opened in Chromium-based browsers (e.g. Google Chrome, Microsoft Edge, Chromium, ...) by entering chrome://tracing into the address bar.
The trace event format and types are defined in this document.
Installation
Install the package from PyPi using the following command.
pip install chrometrace
Usage
import chrometrace
# Create the trace sink as a context manager
with chrometrace.TraceSink(file_like.name) as trace_sink:
# Create a process tracer called myapp from the trace sink
myapp_tracer = trace_sink.process_tracer("myapp", process_id=1337)
# Create a thread tracer for the renderer thread from the process tracer
renderer_thread_tracer = myapp_tracer.thread_tracer("RendererThread", 1)
# Write a complete event at 10 us taking 1000 us with the name my_function
renderer_thread_tracer.complete("my_function", timestamp_us=10, duration_us=1000)
Supported trace formats
Currently only the JSON Array Format is supported due to its simplicity. Support for the JSON Object Format might be added in the future.
Supported trace events
- Duration Events
- Begin
- End
- Complete Events
- Instant Events
- With different scopes
- Counter Events
- Async Events
- Flow Events
- Metadata Events
- Name process / thread
- Define process / thread sort index
- Process labels
- Sample Events
- Object Events
- Mark Events
- Clock Sync Events
- Context Events
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
File details
Details for the file chrometrace-0.1.0.tar.gz
.
File metadata
- Download URL: chrometrace-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.1 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0388ff495cb4dcc06102d0f22c08334f700afca6861ad3e8360d06c62687e5d5 |
|
MD5 | c114d02c8fdacac738d98196790934d7 |
|
BLAKE2b-256 | 5aa5a8ba059cec4cd70d9dd2dcc848ebbc26ee235e37c10a588568b07be44a60 |
File details
Details for the file chrometrace-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chrometrace-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.1 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1be3fe4b5ebc4c983a653749bf7f28fa6dfaba4df28fd51574dcdbedc621b29 |
|
MD5 | feb5824cfb4c18d68868ec9e4ed8a2c8 |
|
BLAKE2b-256 | a1825ad5ac93a4d0d74258991c7a971ee414edc35eeaef32762781844adf3e10 |