pub struct ClusterPerformanceMetrics {
pub per_cluster: HashMap<i64, ClusterMetrics>,
pub global_metrics: ClusterGlobalMetrics,
}Expand description
Cluster-specific performance metrics for V2 graph clustering.
Provides detailed metrics for individual clusters including access patterns, efficiency scores, and utilization data for optimization analysis.
§Examples
use crate::backend::native::v2::wal::metrics::reporting::ClusterPerformanceMetrics;
let mut metrics = ClusterPerformanceMetrics::new();
metrics.update_cluster_stats(42, 100, 500);Fields§
§per_cluster: HashMap<i64, ClusterMetrics>Metrics per cluster ID
global_metrics: ClusterGlobalMetricsGlobal cluster metrics
Implementations§
Source§impl ClusterPerformanceMetrics
impl ClusterPerformanceMetrics
Sourcepub fn new() -> Self
pub fn new() -> Self
Create new cluster performance metrics.
Initializes empty metrics storage ready for cluster-specific performance data collection.
§Returns
A new ClusterPerformanceMetrics instance
Sourcepub fn update_cluster_access(&mut self, cluster_id: i64)
pub fn update_cluster_access(&mut self, cluster_id: i64)
Update cluster access timestamp.
Records when a cluster was last accessed, helping to identify active vs inactive clusters for optimization decisions.
§Arguments
cluster_id- ID of the cluster being accessed
Sourcepub fn update_cluster_stats(
&mut self,
cluster_id: i64,
node_count: u32,
edge_count: u64,
)
pub fn update_cluster_stats( &mut self, cluster_id: i64, node_count: u32, edge_count: u64, )
Update cluster statistics with current data.
Updates comprehensive cluster metrics including node count, edge count, density, and derived efficiency scores.
§Arguments
cluster_id- ID of the cluster to updatenode_count- Current number of nodes in clusteredge_count- Current number of edges in cluster
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset cluster metrics to initial state.
Clears all cluster-specific and global metrics for fresh measurements.
Sourcepub fn get_summary(&self) -> String
pub fn get_summary(&self) -> String
Get cluster performance summary.
Returns a formatted summary of cluster performance metrics suitable for logging and monitoring dashboards.
§Returns
Formatted string with cluster performance summary
Trait Implementations§
Source§impl Clone for ClusterPerformanceMetrics
impl Clone for ClusterPerformanceMetrics
Source§fn clone(&self) -> ClusterPerformanceMetrics
fn clone(&self) -> ClusterPerformanceMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClusterPerformanceMetrics
impl Debug for ClusterPerformanceMetrics
Source§impl Default for ClusterPerformanceMetrics
impl Default for ClusterPerformanceMetrics
Source§fn default() -> ClusterPerformanceMetrics
fn default() -> ClusterPerformanceMetrics
Source§impl<'de> Deserialize<'de> for ClusterPerformanceMetrics
impl<'de> Deserialize<'de> for ClusterPerformanceMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ClusterPerformanceMetrics
impl RefUnwindSafe for ClusterPerformanceMetrics
impl Send for ClusterPerformanceMetrics
impl Sync for ClusterPerformanceMetrics
impl Unpin for ClusterPerformanceMetrics
impl UnwindSafe for ClusterPerformanceMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more