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

Function counter_reset

nodedb-codec/src/delta.rs:302–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300
301 #[test]
302 fn counter_reset() {
303 // Counter with a reset (wrap-around): monotonic then drops to 0.
304 let mut values: Vec<i64> = (0..500).map(|i| i * 100).collect();
305 values.push(0); // reset
306 values.extend((1..500).map(|i| i * 100));
307
308 let encoded = encode(&values);
309 let decoded = decode(&encoded).unwrap();
310 assert_eq!(decoded, values);
311 }
312
313 #[test]
314 fn non_monotonic_gauge() {

Callers

nothing calls this directly

Calls 5

collectMethod · 0.80
encodeFunction · 0.70
decodeFunction · 0.70
pushMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected