add percent helper method to metrics

This commit is contained in:
Bradley Cicenas
2017-06-10 13:00:54 +00:00
parent b49e174483
commit 389dee0f3c
5 changed files with 20 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ func getSysMemTotal() int64 {
return int64(stat.MemTotal * 1024)
}
// return cumulative system cpu usage in nanoseconds
func getSysCPUUsage() uint64 {
stat, err := linuxproc.ReadStat("/proc/stat")
if err != nil {