MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / observe

Method observe

nodedb-cluster/src/loop_metrics.rs:82–86  ·  view source on GitHub ↗

Record a completed tick. Increments `iterations_total` and stores the duration for the `last_iteration_duration_seconds` gauge. Call regardless of success/failure — errors are tracked separately via [`record_error`](Self::record_error).

(&self, duration: Duration)

Source from the content-addressed store, hash-verified

80 /// gauge. Call regardless of success/failure — errors are tracked
81 /// separately via [`record_error`](Self::record_error).
82 pub fn observe(&self, duration: Duration) {
83 let ns = u64::try_from(duration.as_nanos()).unwrap_or(u64::MAX);
84 self.last_iteration_duration_ns.store(ns, Ordering::Relaxed);
85 self.iterations_total.fetch_add(1, Ordering::Relaxed);
86 }
87
88 /// Increment the counter for an error kind. `kind` must be a short
89 /// bounded label — never a formatted error string.

Calls 1

storeMethod · 0.45