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

Method record_wait

nodedb/src/data/io/io_metrics.rs:91–101  ·  view source on GitHub ↗
(&self, tier: usize, wait_ns: u64)

Source from the content-addressed store, hash-verified

89 /// `wait_ns` is elapsed nanoseconds from task-enqueue to read_files return.
90 #[inline]
91 pub fn record_wait(&self, tier: usize, wait_ns: u64) {
92 self.count[tier].fetch_add(1, Ordering::Relaxed);
93 self.sum_ns[tier].fetch_add(wait_ns, Ordering::Relaxed);
94 for (i, &boundary) in IO_WAIT_BUCKETS_NS.iter().enumerate() {
95 if wait_ns <= boundary {
96 self.buckets[tier][i].fetch_add(1, Ordering::Relaxed);
97 return;
98 }
99 }
100 // Overflow: beyond all buckets — counted in `count` but no bucket.
101 }
102
103 /// Emit Prometheus text for all IO metrics.
104 ///

Callers 2

poll_oneMethod · 0.80

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected