Skip to main content

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("trace.json") 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chrometrace-0.2.1.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chrometrace-0.2.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file chrometrace-0.2.1.tar.gz.

File metadata

  • Download URL: chrometrace-0.2.1.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for chrometrace-0.2.1.tar.gz
Algorithm Hash digest
SHA256 81fb4d65b2bf547b1a7ebd2ad0cc5f7ee358d1384cbbe61f11ad199df56040ed
MD5 cf768243d6c869b8732b11195787f9a2
BLAKE2b-256 8bd4717a3a223fe22d56f41954b8f79f90b269ffb0092656e8aa1f60599bc121

See more details on using hashes here.

File details

Details for the file chrometrace-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chrometrace-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e7c3b5acd95f48a1c745533c642cf4b813b75261fbc3d50462c6a8e1347811e
MD5 6692388223f77e7d6f9d4eee2fb14f02
BLAKE2b-256 baea84b2d412d0b7573c0d5291508c8127bfc078d40035201a9d25ec8be30c85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page