1use std::fmt;
4
5use crate::health::HealthStatus;
6
7pub trait MetricsCollector: Send + Sync {
10 fn on_selection(&self, node_id: &dyn fmt::Debug, strategy_name: &str);
12 fn on_health_change(&self, node_id: &dyn fmt::Debug, from: HealthStatus, to: HealthStatus);
14}
15
16pub struct NoopCollector;
18
19impl MetricsCollector for NoopCollector {
20 fn on_selection(&self, _node_id: &dyn fmt::Debug, _strategy_name: &str) {}
21 fn on_health_change(&self, _node_id: &dyn fmt::Debug, _from: HealthStatus, _to: HealthStatus) {
22 }
23}