smelt.metrics.perf¶
Tier: UiHost - Requires a terminal UI; calling these from headless mode raises.
Visibility: Public - Stable Lua API intended for user config and plugins.
Perf instrumentation toggle, clear, and snapshot. UiHost-only.
smelt.metrics.perf.clear¶
Clear all accumulated perf samples (durations and value gauges).
smelt.metrics.perf.enabled¶
Return whether perf instrumentation collection is enabled.
smelt.metrics.perf.set_enabled¶
Toggle perf instrumentation collection on/off. Disabled by default; enable to populate snapshot for the F12 debug panel.
smelt.metrics.perf.snapshot¶
Return the current perf snapshot as { durations, values, enabled } with per-label count, last, p50, p95, p99, max, total fields. Powers detailed diagnostics; prefer snapshot_top for live UI panels.
smelt.metrics.perf.snapshot_top¶
Return a cheap live perf snapshot with only the top limit duration rows and no value rows. Intended for panels that refresh frequently.