pub struct NetworkData {
pub down_mbps: Option<f64>,
pub up_mbps: Option<f64>,
pub ping_ms: Option<f64>,
pub jitter_ms: Option<f64>,
pub packet_loss_percent: Option<f64>,
pub rssi_dbm: Option<f64>,
pub noise_dbm: Option<f64>,
pub channel_width_mhz: Option<f64>,
}Expand description
Represents raw network connection data.
This struct serves as the entry point for Synapse metric calculations. All fields are optional to handle partial cases (e.g., Ethernet without Wi-Fi).
Fields§
§down_mbps: Option<f64>Download speed in Mbps.
up_mbps: Option<f64>Upload speed in Mbps.
ping_ms: Option<f64>Latency (Ping) in milliseconds.
jitter_ms: Option<f64>Jitter (Ping variation) in milliseconds.
packet_loss_percent: Option<f64>Packet loss percentage (e.g., 1.0 for 1%).
rssi_dbm: Option<f64>Received Signal Strength Indicator in dBm (e.g., -65.0). Wireless only.
noise_dbm: Option<f64>Noise floor in dBm (e.g., -90.0). Wireless only.
channel_width_mhz: Option<f64>Wi-Fi channel width in MHz (e.g., 20, 40, 80, 160).
Implementations§
Source§impl NetworkData
impl NetworkData
Sourcepub fn calculate_vortex(&self) -> Option<f64>
pub fn calculate_vortex(&self) -> Option<f64>
Calculates the VORTEX score (Pure flow performance).
The Vortex measures pipe efficiency. It combines volume (speeds) and fluidity (latency/jitter), penalized by integrity (packet loss).
§Returns
Some(score): If all performance data is present.None: If data is missing (ping, speed, etc.).
Sourcepub fn calculate_radiance(&self) -> Option<f64>
pub fn calculate_radiance(&self) -> Option<f64>
Calculates the RADIANCE score (Physical signal quality).
Radiance measures the cleanliness of the radio environment. Based on SNR (Signal-to-Noise Ratio) and channel width.
§Returns
Some(score): If Wi-Fi data is present.None: If wired (Ethernet) or read error.
Sourcepub fn calculate_axon(&self) -> Option<f64>
pub fn calculate_axon(&self) -> Option<f64>
Calculates the final AXON score (Unified Metric).
Axon is the geometric mean of Vortex (Perf) and Radiance (Phys). It represents the “Real Health” of the connection.
Trait Implementations§
Source§impl Clone for NetworkData
impl Clone for NetworkData
Source§fn clone(&self) -> NetworkData
fn clone(&self) -> NetworkData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more