Sergiusz Bazanski | 1affad4 | 2019-04-06 01:21:04 +0200 | [diff] [blame] | 1 | package statusz |
2 | |||||
3 | import "github.com/shirou/gopsutil/load" | ||||
4 | |||||
5 | import "fmt" | ||||
6 | |||||
7 | func loadAverage() string { | ||||
8 | loadstr := "unknown" | ||||
9 | l, err := load.Avg() | ||||
10 | if err == nil { | ||||
11 | loadstr = fmt.Sprintf("%.2f %.2f %.2f", l.Load1, l.Load5, l.Load15) | ||||
12 | } | ||||
13 | return loadstr | ||||
14 | } |