pub fn average_bps(&self) -> Option<f64> {
        let curr_gen = self.curr_gen();
        let min_gen = curr_gen.saturating_sub(BUCKETS);
        self.state.upgrade().map(|s| {
            let s = s.lock().unwrap();
            let total_bytes =
                s.1.iter()
                    .filter(|(r#gen, _)| *r#gen >= min_gen)
                    .map(|(_, bytes)| *bytes)
                    .sum::<usize>();

            // buckets * interval = milliseconds, so we multiply by 1000 to get seconds
            (total_bytes as f64 / (BUCKETS * INTERVAL) as f64) * 1000.0
        })
    }
Get the average bytes per second over the last `SIZE` intervals.

Returns `None` if the `UploadProgress` has been dropped.
crates/turborepo-cache/src/upload_progress.rs