INNER CODE UNIT · Rust

max

orf/gping · gping/src/main.rs:211

        let mut max = ymax.unwrap_or(data_max + (data_max * 10_f64) / 100_f64);

        // Reject negative bounds, and never let the axis collapse to zero height (no
        // data yet, or --ymin pinned above everything we have measured so far).
        min = min.max(0_f64);
        if max <= min {
            max = min + 1000_f64;
        }

        [min, max]
    }

    fn x_axis_bounds(&self) -> [f64; 2] {
        let now = Local::now();
        let now_idx;
        let before_idx;
        if (now - self.started) < self.display_interval {
            now_idx = (self.started + self.display_interval).timestamp_millis() as f64 / 1_000f64;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…