Documentation ¶
Overview ¶
Extract the information on running processes from gopsutil
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByRSSDesc ¶
type ByRSSDesc struct {
ProcessNameGroups
}
type ProcessInfo ¶
type ProcessInfo struct { PID int32 PPID int32 Name string RSS uint64 PctMem float64 VMS uint64 Username string }
func GetProcesses ¶
func GetProcesses() ([]*ProcessInfo, error)
Return a slice of all the processes that are running
type ProcessNameGroup ¶
type ProcessNameGroup struct {
// contains filtered or unexported fields
}
Represents a group of processes, grouped by name
func NewProcessNameGroup ¶
func NewProcessNameGroup() *ProcessNameGroup
func (*ProcessNameGroup) Name ¶
func (pg *ProcessNameGroup) Name() string
func (*ProcessNameGroup) PctMem ¶
func (pg *ProcessNameGroup) PctMem() float64
func (*ProcessNameGroup) Pids ¶
func (pg *ProcessNameGroup) Pids() []int32
func (*ProcessNameGroup) RSS ¶
func (pg *ProcessNameGroup) RSS() uint64
func (*ProcessNameGroup) Usernames ¶
func (pg *ProcessNameGroup) Usernames() []string
Return a slice of the usernames, sorted alphabetically
func (*ProcessNameGroup) VMS ¶
func (pg *ProcessNameGroup) VMS() uint64
type ProcessNameGroups ¶
type ProcessNameGroups []*ProcessNameGroup
func GroupByName ¶
func GroupByName(processInfos []*ProcessInfo) ProcessNameGroups
Group the processInfos by name and return a slice of ProcessNameGroup
func TopRSSProcessGroups ¶
func TopRSSProcessGroups(limit int) (ProcessNameGroups, error)
Return an ordered slice of the process groups that use the most RSS
func (ProcessNameGroups) Swap ¶
func (s ProcessNameGroups) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.