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

Function test_remove_gauge

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

Source from the content-addressed store, hash-verified

512
513 #[test]
514 fn test_remove_gauge() {
515 let mut registry = MetricsRegistry::new("default".to_string());
516
517 let gauge = registry.gauge_mut("test_gauge", "test gauge");
518 gauge.set(42.0);
519
520 let buffer = registry.export_metrics().unwrap();
521 let output = String::from_utf8(buffer).unwrap();
522
523 assert!(output.contains("default_test_gauge 42"));
524
525 registry.remove_gauge("test_gauge");
526
527 let buffer = registry.export_metrics().unwrap();
528 let output = String::from_utf8(buffer).unwrap();
529
530 assert!(!output.contains("default_test_gauge 42"));
531 }
532}

Callers

nothing calls this directly

Calls 4

gauge_mutMethod · 0.80
export_metricsMethod · 0.80
remove_gaugeMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected