Documentation
¶
Overview ¶
Package process performs the following for the "gomon" command: * measurement of each process on the system * observation of the changing state of the process tree * discovery of all the open connections on the system
Index ¶
- func Endpoints(ctx context.Context) error
- func Nodegraph[I any, E any, R any](query Query[I, E, R]) R
- func Observer(ctx context.Context) error
- type CommandLine
- type Connection
- type Directories
- type Endpoint
- type EventID
- type Io
- type Metrics
- type Pid
- type ProcStats
- type Process
- type Properties
- type Query
- type Table
- type Taskstats
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandLine ¶
type CommandLine struct {
Executable string `json:"executable" gomon:"property"`
Args []string `json:"args" gomon:"property"`
Envs []string `json:"envs" gomon:"property"`
}
CommandLine contains a process' command line arguments.
type Connection ¶
type Connection struct {
Type string `json:"type" gomon:"property"`
Self Endpoint `json:"self" gomon:"property"`
Peer Endpoint `json:"peer" gomon:"property"`
}
Connection represents an inter-process or host/data connection.
type Directories ¶
type Directories struct {
Cwd string `json:"cwd" gomon:"property"`
Root string `json:"root" gomon:"property"`
}
Directories reports the process' root and current working directories.
type Endpoint ¶
type Endpoint struct {
Name string `json:"name" gomon:"property"`
Pid Pid `json:"pid" gomon:"property"`
}
Endpoint identifies one end of a connection.
type EventID ¶
type EventID struct {
Name string `json:"name" gomon:"property"`
Pid Pid `json:"pid" gomon:"property"`
Starttime time.Time `json:"starttime" gomon:"property"`
// contains filtered or unexported fields
}
EventID identifies the message.
type Io ¶
type Io struct {
ReadActual int `json:"read_actual" gomon:"counter,B"`
WriteActual int `json:"write_actual" gomon:"counter,B"`
ReadRequested int `json:"read_requested,omitempty" gomon:"counter,B,linux"`
WriteRequested int `json:"write_requested,omitempty" gomon:"counter,B,!windows"`
ReadOperations int `json:"read_operations,omitempty" gomon:"counter,count,!darwin"`
WriteOperations int `json:"write_operations,omitempty" gomon:"counter,count,!darwin"`
}
Io contains a process' I/O metrics.
type Metrics ¶
type Metrics struct {
Priority int `json:"priority,omitempty" gomon:"gauge,none,!windows"`
Threads int `json:"threads" gomon:"gauge,count"`
User time.Duration `json:"user" gomon:"counter,ns"`
System time.Duration `json:"system" gomon:"counter,ns"`
Total time.Duration `json:"total" gomon:"counter,ns"`
Size int `json:"size" gomon:"gauge,B"`
Resident int `json:"resident" gomon:"gauge,B"`
VirtualMemoryMax int `json:"virtual_memory_max,omitempty" gomon:"counter,B,linux"`
ResidentMemoryMax int `json:"resident_memory_max,omitempty" gomon:"counter,B,linux"`
PageFaults int `json:"page_faults" gomon:"counter,count"`
MinorFaults int `json:"minor_faults,omitempty" gomon:"counter,count,linux"`
MajorFaults int `json:"major_faults,omitempty" gomon:"counter,count,linux"`
VoluntaryContextSwitches int `json:"voluntary_context_switches,omitempty" gomon:"counter,count,linux"`
NonVoluntaryContextSwitches int `json:"nonvoluntary_context_switches,omitempty" gomon:"counter,count,linux"`
ContextSwitches int `json:"context_switches,omitempty" gomon:"counter,count,!windows"`
Io `gomon:""`
}
Metrics defines measurement metrics.
type ProcStats ¶
type ProcStats struct {
Count int `json:"count" gomon:"gauge,count"`
Active int `json:"active" gomon:"gauge,count"`
Execed int `json:"execed" gomon:"gauge,count"`
Exited int `json:"exited" gomon:"gauge,count"`
CPU time.Duration `json:"cpu" gomon:"gauge,ns"`
}
ProcStats defines system level process summary metrics. Sent to system.Measure() to include in the system measure.
type Process ¶
type Process = measurement
type Properties ¶
type Properties struct {
Ppid Pid `json:"ppid" gomon:"property"`
Pgid int `json:"pgid,omitempty" gomon:"property,,!windows"`
Tgid int `json:"tgid,omitempty" gomon:"property,,linux"`
Tty string `json:"tty,omitempty" gomon:"property,,!windows"`
UID int `json:"uid,omitempty" gomon:"property,,!windows"`
GID int `json:"gid,omitempty" gomon:"property,,!windows"`
Username string `json:"username" gomon:"property"`
Groupname string `json:"groupname,omitempty" gomon:"property,,!windows"`
Status string `json:"status" gomon:"enum,none"`
Nice int `json:"nice,omitempty" gomon:"gauge,none,!windows"`
CommandLine `gomon:""`
Directories `gomon:""`
}
Properties defines measurement properties.
type Query ¶
type Query[I any, E any, R any] interface { Pid() Pid BuildGraph(Table, Tree, map[Pid]I, map[int]map[Pid]I, map[Pid]I, map[[2]Pid][]E) R HostNode(Connection) I DataNode(Connection) I ProcNode(*Process) I HostEdge(Table, Connection) []E DataEdge(Table, Connection) []E ProcEdge(Table, Pid, Pid) []E Arrow() string }
type Taskstats ¶
type Taskstats struct {
message.Header[netlinkEvent] `gomon:""`
Version uint16 `json:"version" gomon:"property"`
AcExitcode uint32 `json:"ac_exitcode" gomon:"property"`
AcFlag uint8 `json:"ac_flag" gomon:"property"`
AcNice uint8 `json:"ac_nice" gomon:"property"`
CPUCount uint64 `json:"cpu_count" gomon:"gauge,count"`
CPUDelayTotal time.Duration `json:"cpu_delay_total" gomon:"counter,ns"`
BlkioCount uint64 `json:"blkio_count" gomon:"counter,count"`
BlkioDelayTotal time.Duration `json:"blkio_delay_total" gomon:"counter,ns"`
SwapinCount uint64 `json:"swapin_count" gomon:"counter,count"`
SwapinDelayTotal time.Duration `json:"swapin_delay_total" gomon:"counter,ns"`
CPURunRealTotal time.Duration `json:"cpu_run_real_total" gomon:"counter,ns"`
CPURunVirtualTotal time.Duration `json:"cpu_run_virtual_total" gomon:"counter,ns"`
AcComm [32]int8 `json:"ac_comm" gomon:"property"`
AcSched uint8 `json:"ac_sched" gomon:"property"`
AcPad [3]uint8
AcUID uint32 `json:"ac_uid" gomon:"property"`
AcGID uint32 `json:"ac_gid" gomon:"property"`
AcPid uint32 `json:"ac_pid" gomon:"property"`
AcPpid uint32 `json:"ac_ppid" gomon:"property"`
AcBtime uint32 `json:"ac_btime" gomon:"property"`
AcEtime time.Duration `json:"ac_etime" gomon:"counter,ns"`
AcUtime time.Duration `json:"ac_utime" gomon:"counter,ns"`
AcStime time.Duration `json:"ac_stime" gomon:"counter,ns"`
AcMinflt uint64 `json:"ac_minflt" gomon:"counter,count"`
AcMajflt uint64 `json:"ac_majflt" gomon:"counter,count"`
Coremem uint64 `json:"coremem" gomon:"gauge,MB/us"`
Virtmem uint64 `json:"virtmem" gomon:"gauge,MB/us"`
HiwaterRss uint64 `json:"hiwater_rss" gomon:"gauge,B"`
HiwaterVM uint64 `json:"hiwater_vm" gomon:"gauge,B"`
ReadChar uint64 `json:"read_char" gomon:"counter,count"`
WriteChar uint64 `json:"write_char" gomon:"gauge,count"`
ReadSyscalls uint64 `json:"read_syscalls" gomon:"gauge,count"`
WriteSyscalls uint64 `json:"write_syscalls" gomon:"gauge,count"`
Read uint64 `json:"read" gomon:"counter,B"`
Write uint64 `json:"write" gomon:"counter,B"`
CancelledWrite uint64 `json:"cancelled_write" gomon:"counter,B"`
Nvcsw uint64 `json:"nvcsw" gomon:"counter,count"`
Nivcsw uint64 `json:"nivcsw" gomon:"counter,count"`
AcUtimescaled time.Duration `json:"ac_utimescaled" gomon:"counter,ns"`
AcStimescaled time.Duration `json:"ac_stimescaled" gomon:"counter,ns"`
CPUScaledRunRealTotal time.Duration `json:"cpu_scaled_run_real_total" gomon:"counter,ns"`
FreepagesCount uint64 `json:"freepages_count" gomon:"counter,count"`
FreepagesDelayTotal time.Duration `json:"freepages_delay_total" gomon:"counter,ns"`
ThrashingCount uint64 `json:"thrashing_count" gomon:"counter,count"`
ThrashingDelayTotal time.Duration `json:"thrashing_delay_total" gomon:"counter,ns"`
AcBtime64 uint64 `json:"ac_btime64" gomon:"property"`
CompactCount uint64 `json:"compact_count" gomon:"counter,count"`
CompactDelayTotal time.Duration `json:"compact_delay_total" gomon:"counter,ns"`
AcTgid uint32 `json:"ac_tgid" gomon:"property"`
AcTgetime time.Duration `json:"ac_tgettime" gomon:"counter,ns"`
AcExeDev uint64 `json:"ac_exe_dev" gomon:"counter,count"`
AcExeInode uint64 `json:"ac_exe_inode" gomon:"counter,count"`
WpcopyCount uint64 `json:"wpcopy_count" gomon:"counter,count"`
WpcopyDelayTotal uint64 `json:"wpcopy_delay_total" gomon:"counter,ns"`
// contains filtered or unexported fields
}
Taskstats metrics reported on netlink