Documentation ¶
Index ¶
Constants ¶
View Source
const OperationKeyCPUReading = "CPUReading"
OperationKeyCPUReading represents the key for the Operation field of an CPUReadingError
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPU ¶
type CPU struct { TimeInMilSec int ReadCPUStat func(interval time.Duration, percpu bool) ([]float64, error) }
CPU holds the config to get the cpu load in percentage
type Executor ¶
type Executor interface { // Exec executes something and returns the result as a byte array of json and an error if something unexpected happened. Exec(args.Arguments) ([]byte, error) }
Executor is a functional interface to execute a command and return the result as a json string ([]byte).
type Mem ¶
type Mem struct {
ReadVirtualMemoryStat func() (*mem.VirtualMemoryStat, error)
}
Mem holds the memory usage for the json transformation
type Process ¶
Process is an adapter struct for the external process struct from github.com/shirou/gopsutil/process
type Processes ¶
Processes holds the function to get the process list
func NewProcesses ¶
func NewProcesses() Processes
NewProcesses is a factory ctor to build a Processes struct
type Result ¶
Result gethers all the results for all commands
func (Result) ExecCommands ¶
ExecCommands runs all commands
func (Result) ResultEquals ¶
ResultEquals checks for field equality
Click to show internal directories.
Click to hide internal directories.