Documentation
¶
Index ¶
- Constants
- func ApplyProcInterrupts(irqNumber int, cpuset string) error
- func GetCPUInfo() ([]procfs.CPUInfo, error)
- func GetIPVSStats() (procfs.IPVSStats, error)
- func GetMounts() ([]*procfs.MountInfo, error)
- func GetNetDev() (map[string]procfs.NetDevLine, error)
- func GetNetSoftnetStat() ([]procfs.SoftnetStat, error)
- func GetNetStat() ([]procfs.NetStat, error)
- func GetNetTCP() (procfs.NetTCP, error)
- func GetNetTCP6() (procfs.NetTCP, error)
- func GetNetUDP() (procfs.NetUDP, error)
- func GetNetUDP6() (procfs.NetUDP, error)
- func GetPSIStatsForResource(resourceName string) (procfs.PSIStats, error)
- func GetPidCgroups(pid int) ([]procfs.Cgroup, error)
- func GetPidCmdline(pid int) ([]string, error)
- func GetPidComm(pid int) (string, error)
- func GetProcInterrupts() (procfs.Interrupts, error)
- func GetProcMounts(pid int) ([]*procfs.MountInfo, error)
- func GetProcStat() (procfs.Stat, error)
- func GetSchedStat() (*procfs.Schedstat, error)
- func GetSoftirqs() (procfs.Softirqs, error)
- func GetTaskSchedWait(pids []int) (map[int]uint64, error)
- func NewProcFSManager() *manager
- func ReadFileNoStat(filename string) ([]byte, error)
- type ProcFSManager
Constants ¶
const ( IrqRootPath = "/proc/irq" InterruptsFile = "/proc/interrupts" )
Variables ¶
This section is empty.
Functions ¶
func ApplyProcInterrupts ¶
ApplyProcInterrupts applies the given cpuset to the given irq number.
func GetCPUInfo ¶
GetCPUInfo returns the CPUInfo of the host.
func GetIPVSStats ¶
GetIPVSStats returns the IPVSStats of the host.
func GetNetDev ¶
func GetNetDev() (map[string]procfs.NetDevLine, error)
GetNetDev returns the net dev of the host.
func GetNetSoftnetStat ¶
func GetNetSoftnetStat() ([]procfs.SoftnetStat, error)
GetNetSoftnetStat returns the net softnet stat of the host.
func GetNetStat ¶
GetNetStat returns the net stat of the host.
func GetNetTCP6 ¶
GetNetTCP6 returns the net TCP6 of the host.
func GetNetUDP6 ¶
GetNetUDP6 returns the net UDP6 of the host.
func GetPSIStatsForResource ¶
GetPSIStatsForResource returns the psi stats for the given resource.
func GetPidCgroups ¶
GetPidCgroups returns the cgroups of the given pid.
func GetPidCmdline ¶
GetPidCmdline returns the cmdline of the given pid.
func GetPidComm ¶
GetPidComm returns the comm of the given pid.
func GetProcInterrupts ¶
func GetProcInterrupts() (procfs.Interrupts, error)
GetProcInterrupts returns the proc interrupts of the host.
func GetProcMounts ¶
GetProcMounts returns the mounts of the given pid.
func GetProcStat ¶
GetProcStat returns the Stat of the host.
func GetSchedStat ¶
GetSchedStat returns the sched stat of the host.
func GetSoftirqs ¶
GetSoftirqs returns the softirqs of the host.
func GetTaskSchedWait ¶
https://docs.kernel.org/scheduler/sched-stats.html#proc-pid-schedstat schedwait unit: nanosecond
func NewProcFSManager ¶
func NewProcFSManager() *manager
NewProcFSManager return a manager for procfs
func ReadFileNoStat ¶
ReadFileNoStat uses io.ReadAll to read contents of entire file. This is similar to os.ReadFile but without the call to os.Stat, because many files in /proc and /sys report incorrect file sizes (either 0 or 4096). Reads a max file size of 1024kB. For files larger than this, a scanner should be used.
Types ¶
type ProcFSManager ¶
type ProcFSManager interface {
GetCPUInfo() ([]procfs.CPUInfo, error)
GetProcStat() (procfs.Stat, error)
GetPidComm(pid int) (string, error)
GetPidCmdline(pid int) ([]string, error)
GetPidCgroups(pid int) ([]procfs.Cgroup, error)
GetMounts() ([]*procfs.MountInfo, error)
GetProcMounts(pid int) ([]*procfs.MountInfo, error)
GetIPVSStats() (procfs.IPVSStats, error)
GetNetDev() (map[string]procfs.NetDevLine, error)
GetNetStat() ([]procfs.NetStat, error)
GetNetSoftnetStat() ([]procfs.SoftnetStat, error)
GetNetTCP() (procfs.NetTCP, error)
GetNetTCP6() (procfs.NetTCP, error)
GetNetUDP() (procfs.NetUDP, error)
GetNetUDP6() (procfs.NetUDP, error)
GetSoftirqs() (procfs.Softirqs, error)
GetProcInterrupts() (procfs.Interrupts, error)
GetPSIStatsForResource(resourceName string) (procfs.PSIStats, error)
GetSchedStat() (*procfs.Schedstat, error)
ApplyProcInterrupts(irqNumber int, cpuset string) error
}
func GetProcFSManager ¶
func GetProcFSManager() ProcFSManager
GetProcFSManager returns the singleton ProcFSManager.