func Avg() C.sigar_loadavg_t { var sigar *C.sigar_t = GetSigarHandle() var avg C.sigar_loadavg_t C.sigar_loadavg_get(sigar, &avg) return avg }
func _loadAvg(sigar *C.sigar_t) (result []float64, err error) { var c_loadAvg C.sigar_loadavg_t if status := int(C.sigar_loadavg_get(sigar, &c_loadAvg)); status != SIGAR_OK { return nil, fmt.Errorf("Failed to rertieve load avg with error: %v", status) } loadAvg := (([3]C.double)(c_loadAvg.loadavg)) //[:length] return []float64{float64(loadAvg[0]), float64(loadAvg[1]), float64(loadAvg[2])}, nil }