You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bandwidth.rs
    path of file: ./repos/holochain/crates/kitsune_p2p/kitsune_p2p/src/gossip/sharded_gossip
    
    the code of the file until where you have to start completion: use std::{
    num::NonZeroU32,
    sync::atomic::{AtomicU64, AtomicUsize},
};

use governor::{clock::Clock, Quota};

use super::*;

#[derive(Clone)]
/// Set of bandwidth throttles for all gossip loops.
pub struct BandwidthThrottles {
    recent: Arc<BandwidthThrottle>,
    historic: Arc<BandwidthThrottle>,
}

impl BandwidthThrottles {
    /// Create a new set of throttles from the configuration.
    pub fn new(tuning_params: &KitsuneP2pTuningParams) -> Self {
        let recent = BandwidthThrottle::new(
            tuning_params.gossip_inbound_target_mbps,
            tuning_params.gossip_outbound_target_mbps,
            tuning_params.gossip_burst_ratio,
        );
        let historic = BandwidthThrottle::ne
    
    pub async fn incoming_bytes(&self, bytes: usize) {
        if let Some(bits) = NonZeroU32::new(bytes as u32 * 8) {
            if let Some(inbound) = &self.inbound {
                self.try_throttle("receive", inbound, bytes, bits).await;
            }
            let el = self.start_time.elapsed();
            let last_s = self
                .last_inbound_time
                .swap(el.as_secs(), std::sync::atomic::Ordering::Relaxed);
            let total_bits = self
                .bits_inbound
                .fetch_add(bits.get() as usize, std::sync::atomic::Ordering::Relaxed)
                + bits.get() as usize;
            let bps = total_bits
                .checked_div(el.as_secs() as usize)
                .unwrap_or_default();
            let current_bps = (bits.get() as u64).checked_div(last_s).unwrap_or_default();
            let max_bps = self
                .peak_inbound
                .fetch_max(bps, std::sync::atomic::Ordering::Relaxed)
                .max(bps);
            let s = tracing::trace_span!("bandwidth");
            s.in_scope(|| {
                tracing::trace!(
                    "Inbound current: {}bps {:.2}mbps, average: {}bps {:.2}mbps, max: {}bps {:.2}mbps",
                    current_bps,
                    current_bps as f64 / 1_000_000.0,
                    bps,
                    bps as f64 / 1_000_000.0,
                    max_bps,
                    max_bps as f64 / 1_000_000.0
                )
            })
        }
    }