Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synapse

Crates.io Downloads docs.rs License CI

Synapse scores real-world network quality from measurements you already have. It does not run speed tests — you collect the numbers; Synapse turns them into three metrics:

Metric Role Inputs
Vortex Performance / flow down/up Mbps, ping, jitter, packet loss
Radiance Wireless physical quality RSSI, noise floor, channel width
Axon Unified health √(Vortex × Radiance), or Vortex alone on wired links

Scores are dimensionless. Use ScoreBand for a coarse qualitative reading (critical → excellent).

Installation

[dependencies]
synapse-rs = "1.1"

# Optional Serde support
# synapse-rs = { version = "1.1", features = ["serde"] }

Example

use synapse_rs::{NetworkData, ScoreBand};

fn main() {
    let data = NetworkData::new()
        .with_down_mbps(150.0)
        .with_up_mbps(40.0)
        .with_ping_ms(18.0)
        .with_jitter_ms(2.0)
        .with_packet_loss_percent(0.0)
        .with_rssi_dbm(-60.0)
        .with_noise_dbm(-90.0)
        .with_channel_width_mhz(40.0);

    if let Some(axon) = data.calculate_axon() {
        println!("Axon: {:.2} ({})", axon, ScoreBand::from_score(axon));
    }

    // Prefer try_* when you need structured errors:
    match data.try_vortex() {
        Ok(v) => println!("Vortex: {v:.2}"),
        Err(e) => eprintln!("Vortex unavailable: {e}"),
    }
}

Wired (Ethernet) vs wireless

  • Wireless: Axon is the geometric mean of Vortex and Radiance.
  • Wired (no RSSI/noise/width): Axon falls back to Vortex so Ethernet still gets a health score.
  • If wireless fields are present but invalid (e.g. RSSI below noise), Axon returns an error instead of silently treating the link as wired.

Validation

try_vortex / try_radiance / try_axon reject non-finite values, negative speeds/latency/jitter, packet loss outside 0..=100, zero channel width, and RSSI below the noise floor. The calculate_* helpers return None in those cases.

Examples

cargo run --example axon
cargo run --example vortex
cargo run --example radiance
cargo run --example axon --features serde

Contributing

  1. Fork and clone https://github.com/FlanZCode/synapse
  2. Create a branch: git checkout -b my-feature
  3. Run cargo test, cargo clippy -- -D warnings, and cargo fmt --check
  4. Open a pull request

License

MIT — see LICENSE.

About

A standardized metric system (Vortex, Radiance, Axon) to evaluate real-world network quality beyond simple speed tests.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages