Rindle docs and package mapSkip to main content

Module metrics

Module metrics 

Source
Expand description

Build-gated process metrics (WS03, the metrics feature): metric_inc!/… fold each seam into a relaxed atomic add on a process-global registry the daemon’s Prometheus endpoint reads, and to argument-consuming no-ops (no global linked) otherwise. The scrape-path sibling of observe; see src/metrics.rs. Build-gated process metrics (the metrics feature) — the scrape-path sibling of the observe shim.

observe routes seams to tracing spans/events for sampled diagnostics. Counters do not belong there: a Prometheus counter is just a monotonic number read at scrape time, so routing each increment through an event (callsite check, field capture, subscriber dispatch) is all cost and no benefit — and sampling a counter only trades that cost for an undercount you then have to scale back up. These macros instead fold each seam into a single relaxed atomic add on a process-global registry the metrics endpoint reads directly.

Like observe, this is off by default: with the feature off every macro expands to an argument-consuming no-op and no global is linked (the wasm client and any embedder that doesn’t want the counters pay nothing — verify with cargo tree / a symbol check). The daemon (rindle-server) opts in through its own metrics feature, which enables rindle/metrics.

§Taxonomy (WS03 metric contract; counters unless noted)

NameLabelsSeam
rindle.changes.processedkind = add/remove/editGraph::try_source_push
rindle.build.okbuilder::build_pipeline (Ok)
rindle.build.errorskindbuilder::build_pipeline (Err)
rindle.push.visitedsource_common::gen_push (index candidates)
rindle.push.skippedsource_common::gen_push (index-pruned slots)
rindle.join.probe.hitGraph::push_child_change (the parent fetch ran)
rindle.join.probe.missGraph::push_child_change (the parent fetch was skipped)
rindle.join.precheck.disabledreason = ineligible/observation/maintenancethe join pre-check gate (design 311 §2.5)

The push.skipped / (push.visited + push.skipped) ratio is the guarded-fan-out win (designs/205-GUARDED-PUSH-FANOUT-DESIGN.md §Observability); a visited that tracks total connections flags guard extraction silently failing for a workload. Likewise join.probe.miss / (hit + miss) is the join membership pre-check’s win (designs/311-JOIN-MEMBERSHIP-PRECHECK-DESIGN.md §8): every miss is one reentrant parent fetch that did not run; a rising precheck.disabled says which gate is tripping for the workload.

Labels are &'static str only, so the series count is bounded (no per-row/-query cardinality) — the discipline that keeps a cardinality-billed backend cheap.

Structs§

ApplyBatch
Feature-off twin of the batch scope: a ZST with no Drop, no Instant, no global. apply_batch is a plain fn (not a macro) so a caller in ANOTHER crate — rindle-replica’s apply loop is the one that matters — writes one unconditional line with no #[cfg] of its own and pays nothing here.
Timed

Functions§

apply_batch