Documentation ¶
Index ¶
- Constants
- func DeleteProcessesByDays(days int) error
- func GetTopProcessesAndMetrics(start int64, end int64) (map[int64][]*Process, error)
- func InsertProcesses(processes []Process) error
- func MapProcessToProto(process Process) *gen.Process
- type Factory
- type Process
- type Ps
- type Psutil
- type SystemProcess
Constants ¶
View Source
const ( PsutilType = "psutil" PsType = "ps" )
Variables ¶
This section is empty.
Functions ¶
func DeleteProcessesByDays ¶
DeleteProcessesByDays deletes records older than n days
func GetTopProcessesAndMetrics ¶
GetTopProcessesAndMetrics fetches the top processes based on a criterion like average CPU usage, and then fetches detailed time-series data for each top process.
func InsertProcesses ¶
InsertProcesses inserts multiple processes into the database in bulk
func MapProcessToProto ¶
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implementation for proc providers
func NewFactory ¶
NewFactory init Factory implementation for proc providers
type Process ¶
type Process struct { Id int64 `json:"id" db:"id"` PID int64 `json:"pid" db:"pid"` PPID int64 `json:"ppid" db:"ppid"` Name string `json:"name" db:"name"` // R: Running; S: Sleep; T: Stop; I: Idle; Z: Zombie; W: Wait; L: Lock; Status string `json:"status" db:"status"` CreatedTime int64 `json:"created_time" db:"created_time"` StoredTime int64 `json:"stored_time" db:"stored_time"` OS string `json:"os" db:"os"` Platform string `json:"platform" db:"platform"` PlatformFamily string `json:"platform_family" db:"platform_family"` CPUUsage float64 `json:"cpu_usage" db:"cpu_usage"` MemoryUsage float64 `json:"memory_usage" db:"memory_usage"` }
Process is the model for process
type Ps ¶
type Ps struct {
// contains filtered or unexported fields
}
Ps is the type for the ps process collector
type Psutil ¶
type Psutil struct {
// contains filtered or unexported fields
}
Psutil is the type for the psutil process collector
type SystemProcess ¶
SystemProcess interface for process collection
Click to show internal directories.
Click to hide internal directories.