Struct linux_procfs::System
source · pub struct System { /* private fields */ }
Expand description
system interface of linux-procfs
Implementations§
source§impl System
impl System
sourcepub fn new<P: AsRef<Path>>(base_path: P) -> Self
pub fn new<P: AsRef<Path>>(base_path: P) -> Self
create instance
Example:
use linux_procfs::System;
let mut sys = System::new("/");
sourcepub fn get_loadavg(&mut self) -> LoadAvg
pub fn get_loadavg(&mut self) -> LoadAvg
/proc/loadavg
sourcepub fn get_meminfo(&mut self) -> MemInfo
pub fn get_meminfo(&mut self) -> MemInfo
/proc/meminfo
sourcepub fn get_uptime(&mut self) -> Uptime
pub fn get_uptime(&mut self) -> Uptime
/proc/uptime
sourcepub fn get_vmstat(&mut self) -> VmStat
pub fn get_vmstat(&mut self) -> VmStat
/proc/vmstat
sourcepub fn get_diskstats(&mut self) -> DiskStats
pub fn get_diskstats(&mut self) -> DiskStats
/proc/diskstats
sourcepub fn get_netdevs(&mut self) -> NetDevs
pub fn get_netdevs(&mut self) -> NetDevs
/proc/net/dev
sourcepub fn get_max_cpu_num(&mut self) -> usize
pub fn get_max_cpu_num(&mut self) -> usize
maximum cpu number
sourcepub fn get_cpufreqs(&mut self, max_cpu_num: usize) -> CpuFreqs
pub fn get_cpufreqs(&mut self, max_cpu_num: usize) -> CpuFreqs
/sys/devices/system/cpu/cpu0/cpufreq/
sourcepub fn get_pidentries(&mut self) -> PidEntries
pub fn get_pidentries(&mut self) -> PidEntries
/proc/<pid>/{stat, statm, status, cmdline}
sourcepub fn get_pidentry_stat(&mut self, pid: Pid) -> Option<PidStat>
pub fn get_pidentry_stat(&mut self, pid: Pid) -> Option<PidStat>
/proc/<pid>/stat
sourcepub fn get_pidentry_statm(&mut self, pid: Pid) -> Option<PidStatm>
pub fn get_pidentry_statm(&mut self, pid: Pid) -> Option<PidStatm>
/proc/<pid>/statm
sourcepub fn get_pidentry_status(&mut self, pid: Pid) -> Option<PidStatus>
pub fn get_pidentry_status(&mut self, pid: Pid) -> Option<PidStatus>
/proc/<pid>/status
sourcepub fn get_pidentry_cmdline(&mut self, pid: Pid) -> Option<PidCmdline>
pub fn get_pidentry_cmdline(&mut self, pid: Pid) -> Option<PidCmdline>
/proc/<pid>/cmdline
sourcepub fn get_pidentry_comm(&mut self, pid: Pid) -> Option<PidCmdline>
pub fn get_pidentry_comm(&mut self, pid: Pid) -> Option<PidCmdline>
/proc/<pid>/comm