Skip to main content

Crate keyhog_profile

Crate keyhog_profile 

Source
Expand description

Low-overhead causal profiling for KeyHog runs.

The disabled hot path performs one relaxed atomic load and does not read the clock. An enabled run records fixed scanner stages with allocation-free atomic counters. Run identity, state transitions, and process resources are sampled only at macro boundaries.

Structs§

ResourceSample
Process resource observation associated with a run-state boundary.
ResourceSnapshot
Process resource observation at a macro boundary.
ResourceUsage
Resource change across a completed profile session.
RunIdentity
Identity and execution choices required to compare two run records honestly.
RunProfile
Complete replayable profile record.
Session
One causal profiling session.
SessionActive
Error returned when a process-global profile session is already active.
Span
Allocation-free stage guard. It contains no start timestamp while disabled.
StageMeasurement
One aggregate fixed-stage measurement.
StateTransition
One run-state transition relative to session start.

Enums§

Attribution
Optional attribution for work performed inside a derived input.
CacheState
Cache state that materially changes run cost.
DaemonState
Daemon state that materially changes startup and resident work.
RunState
Coarse causal state of a profiling run.
Stage
Fixed measurement stages shared by scanner, source, verifier, and reporter paths.

Constants§

PROFILE_SCHEMA
Stable wire schema for persisted profiling records.

Functions§

add_input_bytes
Add source bytes processed by the current profile.
add_input_units
Add source units such as files, objects, responses, or chunks.
enabled
Return whether fixed-stage profiling is active.
reset
Discard fixed-stage counters and input totals.
set_attribution
Replace this thread’s attribution and return its previous value.
set_enabled
Enable or disable fixed-stage profiling.
span
Start one fixed-stage measurement.
take_input_totals
Atomically read and clear aggregate input bytes and units.
take_stage_measurements
Atomically read and clear all fixed-stage counters.