()
| 276 | |
| 277 | #[test] |
| 278 | fn registry_renders_every_loop_once() { |
| 279 | let reg = LoopMetricsRegistry::new(); |
| 280 | let a = LoopMetrics::new("a_loop"); |
| 281 | let b = LoopMetrics::new("b_loop"); |
| 282 | a.observe(Duration::from_millis(1)); |
| 283 | b.observe(Duration::from_millis(2)); |
| 284 | reg.register(Arc::clone(&a)); |
| 285 | reg.register(Arc::clone(&b)); |
| 286 | let mut out = String::new(); |
| 287 | reg.render_prom(&mut out); |
| 288 | assert!(out.contains("a_loop_iterations_total 1")); |
| 289 | assert!(out.contains("b_loop_iterations_total 1")); |
| 290 | } |
| 291 | |
| 292 | #[test] |
| 293 | fn registry_register_is_idempotent_by_name() { |
nothing calls this directly
no test coverage detected