pub fn percent_util_since(&self, kind: &WorkSource, start: &Calculations) -> f64 {
        let (start_val, end_val) = match *kind {
            WorkSource::Active => (start.active(), self.active()),
            WorkSource::ActivePlusIoWait => {
                (start.active() + start.iowait, self.active() + self.iowait)
            }
            WorkSource::ActiveMinusNice => (start.active() - start.nice, self.active() - self.nice),
            WorkSource::User => (start.user, self.user),
            WorkSource::IoWait => (start.iowait, self.iowait),
            WorkSource::Nice => (start.nice, self.nice),
            WorkSource::System => (start.system, self.system),
            WorkSource::Idle => (start.idle, self.idle),
            WorkSource::Irq => (start.irq, self.irq),
            WorkSource::SoftIrq => (start.softirq, self.softirq),
            WorkSource::Steal => (start.steal, self.steal),
            WorkSource::Guest => (start.guest, self.guest),
            WorkSource::GuestNice => (
                start.guest_nice.unwrap_or_else(|| Jiffies::new(0)),
                self.guest_nice.unwrap_or_else(|| Jiffies::new(0)),
            ),
        };
        assert!(self.total() >= start.total());
        let total = (end_val - start_val) / (self.total() - start.total());
        total * 100f64
    }
/// Return how much cpu time the specific worksource took
///
/// The number returned is between 0 and 100
Return how much cpu time the specific worksource took
The number returned is between 0 and 100
Return how much cpu time the specific worksource took The number returned is between 0 and 100
pub fn percent_util_since(&self, kind: &WorkSource, start: &Calculations) -> f64 {
        let (start_val, end_val) = match *kind {
            WorkSource::Active => (start.active(), self.active()),
            WorkSource::ActivePlusIoWait => {
                (start.active() + start.iowait, self.active() + self.iowait)
            }
            WorkSource::ActiveMinusNice => (start.active() - start.nice, self.active() - self.nice),
            WorkSource::User => (start.user, self.user),
            WorkSource::IoWait => (start.iowait, self.iowait),
            WorkSource::Nice => (start.nice, self.nice),
            WorkSource::System => (start.system, self.system),
            WorkSource::Idle => (start.idle, self.idle),
            WorkSource::Irq => (start.irq, self.irq),
            WorkSource::SoftIrq => (start.softirq, self.softirq),
            WorkSource::Steal => (start.steal, self.steal),
            WorkSource::Guest => (start.guest, self.guest),
            WorkSource::GuestNice => (
                start.guest_nice.unwrap_or_else(|| Jiffies::new(0)),
                self.guest_nice.unwrap_or_else(|| Jiffies::new(0)),
            ),
        };
        assert!(self.total() >= start.total());
        let total = (end_val - start_val) / (self.total() - start.total());
        total * 100f64
    }
pub fn percent_util_since ( & self , kind : & WorkSource , start : & Calculations ) -> f64 { let ( start_val , end_val ) = match * kind { WorkSource :: Active => ( start . active ( ) , self . active ( ) ) , WorkSource :: ActivePlusIoWait => { ( start . active ( ) + start . iowait , self . active ( ) + self . iowait ) } WorkSource :: ActiveMinusNice => ( start . active ( ) - start . nice , self . active ( ) - self . nice ) , WorkSource :: User => ( start . user , self . user ) , WorkSource :: IoWait => ( start . iowait , self . iowait ) , WorkSource :: Nice => ( start . nice , self . nice ) , WorkSource :: System => ( start . system , self . system ) , WorkSource :: Idle => ( start . idle , self . idle ) , WorkSource :: Irq => ( start . irq , self . irq ) , WorkSource :: SoftIrq => ( start . softirq , self . softirq ) , WorkSource :: Steal => ( start . steal , self . steal ) , WorkSource :: Guest => ( start . guest , self . guest ) , WorkSource :: GuestNice => ( start . guest_nice . unwrap_or_else ( | | Jiffies :: new ( 0 ) ) , self . guest_nice . unwrap_or_else ( | | Jiffies :: new ( 0 ) ) , ) , } ; assert ! ( self total ( ) start total ( ) ) ; let total = ( end_val - start_val ) / ( self . total ( ) - start . total ( ) ) ; total * 100f64 }
Return how much cpu time the specific worksource took
The number returned is between 0 and 100
Return how much cpu time the specific worksource took The number returned is between 0 and 100
&self
kind
&WorkSource
start
&Calculations
&self
kind
&WorkSource
start
&Calculations