// 1000 millicpu equals to 1vCPU, 0 means unlimited
1000 millicpu equals to 1vCPU, 0 means unlimited
1000 millicpu equals to 1vCPU 0 means unlimited
pub fn new(
        cpu_quota: usize,
        write_bandwidth: ReadableSize,
        read_bandwidth: ReadableSize,
    ) -> Self {
        let cputime_limiter = if cpu_quota == 0 {
            Limiter::new(f64::INFINITY)
        } else {
            Limiter::new(cpu_quota as f64 * CPU_TIME_FACTOR * 1000_f64)
        };
        let write_bandwidth_limiter = if write_bandwidth.0 == 0 {
            Limiter::new(f64::INFINITY)
        } else {
            Limiter::new(write_bandwidth.0 as f64)
        };
        let read_bandwidth_limiter = if read_bandwidth.0 == 0 {
            Limiter::new(f64::INFINITY)
        } else {
            Limiter::new(read_bandwidth.0 as f64)
        };
        Self {
            cputime_limiter,
            write_bandwidth_limiter,
            read_bandwidth_limiter,
        }
    }
pub fn new ( cpu_quota : usize , write_bandwidth : ReadableSize , read_bandwidth : ReadableSize , ) -> Self { let cputime_limiter = if cpu_quota == 0 { Limiter :: new ( f64 :: INFINITY ) } else { Limiter :: new ( cpu_quota as f64 * CPU_TIME_FACTOR * 1000_f64 ) } ; let write_bandwidth_limiter = if write_bandwidth . 0 == 0 { Limiter :: new ( f64 :: INFINITY ) } else { Limiter :: new ( write_bandwidth . 0 as f64 ) } ; let read_bandwidth_limiter = if read_bandwidth . 0 == 0 { Limiter :: new ( f64 :: INFINITY ) } else { Limiter :: new ( read_bandwidth . 0 as f64 ) } ; Self { cputime_limiter , write_bandwidth_limiter , read_bandwidth_limiter , } }
1000 millicpu equals to 1vCPU, 0 means unlimited
1000 millicpu equals to 1vCPU 0 means unlimited
cpu_quota
usize
write_bandwidth
ReadableSize
read_bandwidth
ReadableSize