in lib/ec2macossystemmonitor/cpuutilization.go [12:18]
func RunningCpuUsage() (s string, err error) {
percent, err := cpu.Percent(0, false)
if err != nil {
return "", fmt.Errorf("ec2macossystemmonitor: error while getting cpu stats: %s", err)
}
return strconv.FormatFloat(percent[0], 'f', -1, 64), nil
}