Module metrics
Source - SpanGuard
- cd
- Convenience: attach current metrics to an Envelope (appends to
timings) - list_markers
- List marker names in order of recording
- mark
- Record a timing marker with a human-readable name.
The first call is considered the “start” marker for cumulative timings.
- span
- Start an ad-hoc span; recorded when the guard is dropped.
- span_between
- Compute (and optionally record) a span between two named markers.
Returns
Some(seconds) if both markers exist and end is after start. - span_between_indices
- Record a custom-named span between two markers by index in the recorded order.
Example: 0-based indices; span_between_indices(3, 5, “apply_total”)
- span_between_markers
- Record a custom-named span between two named markers (first occurrence of each)
Returns seconds if both markers exist and order is valid.
- take_as_timings
- Drain the current recorder as a list of
Timing entries.
Includes: