diff options
Diffstat (limited to 'src/rpc/system_metrics.rs')
-rw-r--r-- | src/rpc/system_metrics.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rpc/system_metrics.rs b/src/rpc/system_metrics.rs index ffbef6df..fb3c983c 100644 --- a/src/rpc/system_metrics.rs +++ b/src/rpc/system_metrics.rs @@ -3,7 +3,6 @@ use std::time::{Duration, Instant}; use opentelemetry::{global, metrics::*, KeyValue}; -use crate::ring::Ring; use crate::system::{ClusterHealthStatus, System}; /// TableMetrics reference all counter used for metrics @@ -215,9 +214,9 @@ impl SystemMetrics { let system = system.clone(); meter .u64_value_observer("cluster_layout_node_connected", move |observer| { - let ring: Arc<Ring> = system.ring.borrow().clone(); + let layout = system.cluster_layout(); let nodes = system.get_known_nodes(); - for (id, _, config) in ring.layout.roles.items().iter() { + for (id, _, config) in layout.current().roles.items().iter() { if let Some(role) = &config.0 { let mut kv = vec![ KeyValue::new("id", format!("{:?}", id)), @@ -259,9 +258,9 @@ impl SystemMetrics { let system = system.clone(); meter .u64_value_observer("cluster_layout_node_disconnected_time", move |observer| { - let ring: Arc<Ring> = system.ring.borrow().clone(); + let layout = system.cluster_layout(); let nodes = system.get_known_nodes(); - for (id, _, config) in ring.layout.roles.items().iter() { + for (id, _, config) in layout.current().roles.items().iter() { if let Some(role) = &config.0 { let mut kv = vec![ KeyValue::new("id", format!("{:?}", id)), |