pub struct CoordinationMetricsManager { /* private fields */ }Expand description
Manager for tracking coordination metrics
Implementations§
Source§impl CoordinationMetricsManager
impl CoordinationMetricsManager
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable metrics tracking
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if metrics tracking is enabled
Sourcepub fn record_leadership_change(&mut self, _became_leader: bool)
pub fn record_leadership_change(&mut self, _became_leader: bool)
Record a leadership change
Sourcepub fn record_write_conflict(&mut self)
pub fn record_write_conflict(&mut self)
Record a write conflict
Sourcepub fn record_follower_refresh(&mut self)
pub fn record_follower_refresh(&mut self)
Record a follower refresh
Sourcepub fn record_notification_latency(&mut self, latency_ms: f64)
pub fn record_notification_latency(&mut self, latency_ms: f64)
Record notification latency in milliseconds
Sourcepub fn get_metrics(&self) -> &CoordinationMetrics
pub fn get_metrics(&self) -> &CoordinationMetrics
Get current metrics
Sourcepub fn get_metrics_json(&self) -> Result<String, String>
pub fn get_metrics_json(&self) -> Result<String, String>
Get metrics as JSON string
Sourcepub fn get_leadership_changes_per_minute(&self) -> f64
pub fn get_leadership_changes_per_minute(&self) -> f64
Get leadership changes per minute
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoordinationMetricsManager
impl RefUnwindSafe for CoordinationMetricsManager
impl Send for CoordinationMetricsManager
impl Sync for CoordinationMetricsManager
impl Unpin for CoordinationMetricsManager
impl UnwindSafe for CoordinationMetricsManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more