MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / getLoadAverage

Method getLoadAverage

agent-source-code/internal/system/system.go:399–407  ·  view source on GitHub ↗

getLoadAverage gets system load average

(ctx context.Context)

Source from the content-addressed store, hash-verified

397
398// getLoadAverage gets system load average
399func (d *Detector) getLoadAverage(ctx context.Context) []float64 {
400 loadAvg, err := load.AvgWithContext(ctx)
401 if err != nil {
402 d.logger.WithError(err).Warn("Failed to get load average")
403 return []float64{0, 0, 0}
404 }
405
406 return []float64{loadAvg.Load1, loadAvg.Load5, loadAvg.Load15}
407}
408
409// GetMachineID returns the system's machine ID using gopsutil
410func (d *Detector) GetMachineID() string {

Callers 1

GetSystemInfoMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected