()
| 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 | } |
nothing calls this directly
no test coverage detected