mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 23:26:45 +08:00
add percent helper method to metrics
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user