MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / getLoad

Function getLoad

metric/loadavg_unix.go:26–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24import "C"
25
26func getLoad() ([]float64, error) {
27 var loadavg [3]C.double
28 samples := C.getloadavg(&loadavg[0], 3)
29 if samples != 3 {
30 return nil, errors.New("failed to get load average")
31 }
32 return []float64{float64(loadavg[0]), float64(loadavg[1]), float64(loadavg[2])}, nil
33}

Callers 1

UpdateMethod · 0.70

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected