pub fn load() -> Result<Stat, io::Error> {
                    let contents = read_file("/sys/fs/cgroup/cpuacct/cpuacct.stat")?;
                    let mut lines = contents.lines();
                    let user = lines.next().unwrap().split(' ').nth(1).unwrap();
                    let sys = lines.next().unwrap().split(' ').nth(1).unwrap();

                    Ok(Stat {
                        user: UserHz::new(user.parse().unwrap()),
                        system: UserHz::new(sys.parse().unwrap()),
                    })
                }
/// Create a new `Stat` with values for the cgroup fs
Create a new `Stat` with values for the cgroup fs
Create a new ` Stat ` with values for the cgroup fs
pub fn load() -> Result<Stat, io::Error> {
                    let contents = read_file("/sys/fs/cgroup/cpuacct/cpuacct.stat")?;
                    let mut lines = contents.lines();
                    let user = lines.next().unwrap().split(' ').nth(1).unwrap();
                    let sys = lines.next().unwrap().split(' ').nth(1).unwrap();
                    Ok(Stat {
                        user: UserHz::new(user.parse().unwrap()),
                        system: UserHz::new(sys.parse().unwrap()),
                    })
                }
pub fn load ( ) -> Result < Stat , io :: Error > { let contents = read_file ( " " ) ? ; let mut lines = contents . lines ( ) ; let user = lines . next ( ) . unwrap ( ) . split ( ' ' ) . nth ( 1 ) . unwrap ( ) ; let sys = lines . next ( ) . unwrap ( ) . split ( ' ' ) . nth ( 1 ) . unwrap ( ) ; Ok ( Stat { user : UserHz :: new ( user . parse ( ) . unwrap ( ) ) , system : UserHz :: new ( sys . parse ( ) . unwrap ( ) ) , } ) }
Create a new `Stat` with values for the cgroup fs
Create a new ` Stat ` with values for the cgroup fs