pub struct DhtStats {
pub total_registrations: usize,
pub unique_keys: usize,
pub unique_trust_roots: usize,
pub max_registrations_per_key: usize,
pub avg_registrations_per_key: f64,
pub path_depth_histogram: Vec<usize>,
pub memory_bytes: usize,
}Expand description
Statistics about the DHT state.
Used for evaluation metrics and monitoring.
Fields§
§total_registrations: usizeTotal number of active registrations.
unique_keys: usizeNumber of unique DHT keys with registrations.
unique_trust_roots: usizeNumber of unique trust roots.
max_registrations_per_key: usizeMaximum registrations at any single key.
This counts materialized copies, so the largest bucket is ordinarily an
ancestor key holding a whole subtree. It is an observation and not a
limit: nothing bounds it, and it routinely exceeds
SimulationConfig::max_registrations_per_capability, which bounds
only the key an agent registers at.
avg_registrations_per_key: f64Average registrations per key.
path_depth_histogram: Vec<usize>Histogram of path depths.
memory_bytes: usizeEstimated memory usage in bytes.
Implementations§
Source§impl DhtStats
impl DhtStats
Sourcepub const fn total_registrations(&self) -> usize
pub const fn total_registrations(&self) -> usize
Returns the total registrations.
Sourcepub const fn unique_keys(&self) -> usize
pub const fn unique_keys(&self) -> usize
Returns the unique keys count.
Sourcepub const fn unique_trust_roots(&self) -> usize
pub const fn unique_trust_roots(&self) -> usize
Returns the unique trust roots count.
Sourcepub const fn max_registrations_per_key(&self) -> usize
pub const fn max_registrations_per_key(&self) -> usize
Returns the maximum registrations at any key.
See DhtStats::max_registrations_per_key for why this is not bounded
by the configured capacity.
Sourcepub const fn avg_registrations_per_key(&self) -> f64
pub const fn avg_registrations_per_key(&self) -> f64
Returns the average registrations per key.
Sourcepub const fn memory_bytes(&self) -> usize
pub const fn memory_bytes(&self) -> usize
Returns the memory usage estimate.