1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Project-wide constants. Centralizes magic numbers so they are not
//! duplicated across modules.
use Duration;
/// Per-connection TCP connect timeout for the speed-test HTTP client. Kept
/// short so that when a family is pinned via `--ipv4-only` / `--ipv6-only` and
/// that family has no working route, connects fail fast instead of stalling on
/// the overall request timeout.
pub const HTTP_CONNECT_TIMEOUT: Duration = from_secs;
/// Waveform-style bufferbloat thresholds: (max latency increase in ms, grade).
/// The first row whose threshold the measured value is <= to wins.
/// `f64::INFINITY` serves as the catch-all for F.
pub const BUFFERBLOAT_THRESHOLDS: & = &;
/// Stability thresholds: (max coefficient of variation in percent, grade).
/// First matching row wins. Calibrated against typical observed CV ranges
/// (wired fiber ~2-4%, decent Wi-Fi ~8-15%, congested ~20%+).
pub const STABILITY_THRESHOLDS: & = &;
/// Sentinel grade used in `ConnectionQuality` when one half (bufferbloat
/// or stability) cannot be computed but the other can. Single-character
/// hyphen, never the em dash.
pub const GRADE_UNAVAILABLE: &str = "-";
/// Minimum number of throughput samples required to compute a CV
/// (stddev of fewer than 3 samples is meaningless).
pub const MIN_STABILITY_SAMPLES: usize = 3;