Expand description
Drive wasmtime’s GuestProfiler for you and emit gzip’d pprof
directly. Spares callers from the epoch-tick / take-and-restore
plumbing and the JSON-intermediate step.
§Quick start
See runners/wasmtime-runner/src/main.rs in this repo for a worked
example; the key types are ProfileSession, ProfilerHost, and
TakeProfileSession.
Structs§
- Epoch
Ticker - Background thread that bumps wasmtime’s epoch counter on a fixed cadence so the deadline callback fires. RAII — drop to stop.
- Profile
Session - Owned wrapper around wasmtime’s
GuestProfiler.
Traits§
- Profiler
Host - Implemented by your
Store<T>data so the crate can find theProfileSessionin the deadline callback. - Profiler
Host Ext - Methods auto-applied to any type that implements
ProfilerHost. - Take
Profile Session - Companion trait for stores whose data owns the session — needed to
extract the session out of a consumed
Store.
Functions§
- json_
to_ pprof - Convert Firefox Profiler JSON bytes into gzip’d pprof.