MCPcopy Create free account
hub / github.com/dfinity/orbit / test_remove_counter

Function test_remove_counter

libs/orbit-essentials/src/metrics.rs:472–489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

470
471 #[test]
472 fn test_remove_counter() {
473 let mut registry = MetricsRegistry::new("default".to_string());
474
475 let counter = registry.counter_mut("test_counter", "test counter");
476 counter.inc();
477
478 let buffer = registry.export_metrics().unwrap();
479 let output = String::from_utf8(buffer).unwrap();
480
481 assert!(output.contains("default_test_counter 1"));
482
483 registry.remove_counter("test_counter");
484
485 let buffer = registry.export_metrics().unwrap();
486 let output = String::from_utf8(buffer).unwrap();
487
488 assert!(!output.contains("default_test_counter 1"));
489 }
490
491 #[test]
492 fn test_remove_gauge_vec() {

Callers

nothing calls this directly

Calls 4

counter_mutMethod · 0.80
export_metricsMethod · 0.80
remove_counterMethod · 0.80
incMethod · 0.45

Tested by

no test coverage detected