Documentation
¶
Overview ¶
procfs contains several low level functions to read information from /proc filesystem, and also provides some utility functions like JiffiesToDuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JiffiesToDuration ¶
Types ¶
type ProcessSchedStat ¶
type ProcessSchedStat struct {
// Number of processes
NumProcesses int
// Total time spent on the cpu (Unit: nanoseconds)
Running uint64
// Total time spent waiting on a runqueue (Unit: nanoseconds)
RunWait uint64
// # of timeslices run on this cpu. i.e. # of times run on the cpu
NumTimeSlices uint64
}
func (*ProcessSchedStat) Add ¶
func (self *ProcessSchedStat) Add(pid int) error
Add() read the schedstat of pid, and add stat to the fields in self parameters. This function is useful if one wants to read stats of a group of processes.
type SchedulerLoadReader ¶
type SchedulerLoadReader interface {
// Load() returns the load of each core of given container. If there's
// no information of given container, it should return nil, nil. If the
// returned load is not nil, the number of elements in the returned
// slice must be the same as the number of cores on the machine. Each
// element in the returned slices represents number of tasks/threads in
// the container and waiting for the CPU, i.e. number of runnable
// tasks.
Load(container string) ([]int, error)
AllContainers() ([]string, error)
}
func NewSchedulerLoadReader ¶
func NewSchedulerLoadReader() (SchedulerLoadReader, error)
Click to show internal directories.
Click to hide internal directories.