()
| 450 | |
| 451 | #[test] |
| 452 | fn test_remove_counter_vec() { |
| 453 | let mut registry = MetricsRegistry::new("default".to_string()); |
| 454 | |
| 455 | let counter = registry.counter_vec_mut("test_counter", &["status"], "testing metric"); |
| 456 | counter.with(&labels! { "status" => "ok" }).inc(); |
| 457 | |
| 458 | let buffer = registry.export_metrics().unwrap(); |
| 459 | let output = String::from_utf8(buffer).unwrap(); |
| 460 | |
| 461 | assert!(output.contains("default_test_counter{status=\"ok\"} 1")); |
| 462 | |
| 463 | registry.remove_counter_vec("test_counter"); |
| 464 | |
| 465 | let buffer = registry.export_metrics().unwrap(); |
| 466 | let output = String::from_utf8(buffer).unwrap(); |
| 467 | |
| 468 | assert!(!output.contains("default_test_counter{status=\"ok\"} 1")); |
| 469 | } |
| 470 | |
| 471 | #[test] |
| 472 | fn test_remove_counter() { |
nothing calls this directly
no test coverage detected