Skip to content

Primitive tracing with flame graph export

License

Notifications You must be signed in to change notification settings

paiv/local-tracer-swift

Repository files navigation

LocalTracer

standwithukraine

Low-effort tracer of hand-picked code flows.

Installation

Swift Package Manager

Add package dependency:

.package(url:"[email protected]/paiv/local-tracer-swift.git", .branch:"main"),
...
.dependencies(["LocalTracer"])

Usage

let storage = LocalTracerInMemoryEventStorage()
let tracer = LocalTracer(storage: storage)

let trace = tracer.traceStart("name", category: "category")
tracer.traceEnd(trace)

tracer.exportEventsAndResetStorage()

See Examples for practical tracing.

Export format

The exported JSON document adheres to Trace Event Format, and can be rendered in

About

Primitive tracing with flame graph export

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages