Skip to main content

stats

Function stats 

Source
pub(crate) async fn stats(__arg0: State<Arc<PathBuf>>) -> Response
Expand description

Everything this node knows about itself, in one document.

The shape is the argument. Mira is a telemetry backend, so the wrong move is to grow a second one inside it: no exposition format, no registry, no histograms, no scrape endpoint on a second port and no crate to render any of that. What is served is the counters the ingest path already keeps, plus the two facts only the filesystem has, in the same JSON object every /api/v1 read already answers with — so the UI’s fetch, an agent and curl | jq all speak it without being told. Rates are left to the reader: uptime_s is the denominator, and two polls give the interval rate, which is the only rate that is true of now rather than of the whole run.