pub struct NetworkHealth {
pub online_nodes: u64,
pub avg_uptime_percent: f64,
pub avg_latency_ms: f64,
pub avg_replication_factor: f64,
pub content_availability_percent: f64,
pub failed_proofs_24h: u64,
pub successful_proofs_24h: u64,
pub timestamp: DateTime<Utc>,
}Expand description
Network health metrics.
§Examples
use chie_shared::NetworkHealth;
let health = NetworkHealth {
online_nodes: 500,
avg_uptime_percent: 99.5,
avg_latency_ms: 45.0,
avg_replication_factor: 4.2,
content_availability_percent: 98.5,
failed_proofs_24h: 50,
successful_proofs_24h: 10_000,
timestamp: chrono::Utc::now(),
};
// Assess network health
let is_healthy = health.avg_uptime_percent > 95.0
&& health.avg_latency_ms < 100.0
&& health.content_availability_percent > 95.0;
assert!(is_healthy);
// Calculate success rate
let total_proofs = health.successful_proofs_24h + health.failed_proofs_24h;
let success_rate = health.successful_proofs_24h as f64 / total_proofs as f64;
assert!(success_rate > 0.99);Fields§
§online_nodes: u64Number of online nodes.
avg_uptime_percent: f64Average node uptime (percentage).
avg_latency_ms: f64Average latency (milliseconds).
avg_replication_factor: f64Network replication factor (average copies per content).
content_availability_percent: f64Percentage of content with at least 3 seeders.
failed_proofs_24h: u64Failed proof submissions (last 24h).
successful_proofs_24h: u64Successful proof submissions (last 24h).
timestamp: DateTime<Utc>Health check timestamp.
Trait Implementations§
Source§impl Clone for NetworkHealth
impl Clone for NetworkHealth
Source§fn clone(&self) -> NetworkHealth
fn clone(&self) -> NetworkHealth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkHealth
impl Debug for NetworkHealth
Source§impl<'de> Deserialize<'de> for NetworkHealth
impl<'de> Deserialize<'de> for NetworkHealth
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NetworkHealth
impl RefUnwindSafe for NetworkHealth
impl Send for NetworkHealth
impl Sync for NetworkHealth
impl Unpin for NetworkHealth
impl UnwindSafe for NetworkHealth
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