Skip to main content

Crate piano_runtime

Crate piano_runtime 

Source

Structs§

AdoptGuard
RAII guard for cross-thread adoption. Pops the synthetic parent on drop and propagates CPU time back to the parent’s SpanContext.
FrameFnSummary
Per-function summary within a single frame.
FunctionRecord
Aggregated timing data for a single function.
Guard
RAII timing guard. Records elapsed time on drop.
InvocationRecord
Per-invocation measurement record with nanosecond precision.
PianoAllocator
A global allocator wrapper that tracks allocation counts and bytes per instrumented function scope, with zero timing distortion.
SpanContext
Context for propagating parent-child CPU timing across thread boundaries.

Functions§

adopt
Adopt a parent span context on a child thread.
collect
Aggregate raw records into per-function summaries, sorted by self_ms descending. Reads only from the current thread’s record storage.
collect_all
Collect records from ALL threads via the global registry. This is the primary collection method for cross-thread profiling — it captures data from thread-pool workers whose TLS destructors may never fire.
collect_frames
Return completed per-frame summaries.
enter
Start timing a function. Returns a Guard that records the measurement on drop.
flush
Flush collected timing data to disk.
fork
Capture the current stack top as a cross-thread span context.
init
No-op retained for API compatibility.
register
Register a function name so it appears in output even if never called.
reset
Clear all collected timing data for the current thread.
set_runs_dir
Configure the directory where run files should be written.
shutdown
Flush all collected timing data from ALL threads and write to disk.
shutdown_to
Like shutdown, but writes run files to the specified directory.