Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GroupedProcessInfo ¶
type GroupedProcessInfo struct {
Name string `json:"name"`
PIDs []uint32 `json:"pid.list"`
ParentPID uint32 `json:"parent_pid"`
Command string `json:"command,omitempty"`
Load1 float64 `json:"load1_percent"`
Load5 float64 `json:"load5_percent"`
Load15 float64 `json:"load15_percent"`
}
GroupedProcessInfo is grouped stats for the processes with same (ParentPID, Name, Command)
type Process ¶
type Process struct {
PID uint32
ParentPID uint32
Load float64
Load1 *ring.Ring
Load5 *ring.Ring
Load15 *ring.Ring
Command string
Identifier string
}
Process is used to store aggregated load data about an OS process
type ProcessInfoSlice ¶
type ProcessInfoSlice []*GroupedProcessInfo
ProcessInfoSlice is used for sorting
func (ProcessInfoSlice) Len ¶
func (s ProcessInfoSlice) Len() int
func (ProcessInfoSlice) Less ¶
func (s ProcessInfoSlice) Less(i, j int) bool
func (ProcessInfoSlice) Swap ¶
func (s ProcessInfoSlice) Swap(i, j int)
type ProcessInfoSnapshot ¶
type ProcessInfoSnapshot struct {
Name string
PID uint32
ParentPID uint32
Command string
Load float64
}
ProcessInfoSnapshot is used to store a snapshot of load data about an OS process
type Top ¶
type Top struct {
// contains filtered or unexported fields
}
Top holds a map with information about process loads
func (*Top) GetProcesses ¶
func (t *Top) GetProcesses(interval time.Duration) ([]*ProcessInfoSnapshot, error)
func (*Top) HighestNLoad ¶
func (t *Top) HighestNLoad(n int) []*GroupedProcessInfo
Click to show internal directories.
Click to hide internal directories.