|
@@ -60,19 +60,19 @@ func GetTop10() []string {
|
|
|
return top10
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
func GetCpuPercent() float64 {
|
|
|
percent, _ := cpu.Percent(time.Second, false)
|
|
|
return percent[0]
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
func GetMemoryPercent() float64 {
|
|
|
memory, _ := mem.SwapMemory()
|
|
|
return memory.UsedPercent
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
func GetDiskPercent() float64 {
|
|
|
parts, _ := disk.Partitions(true)
|
|
|
diskInfo, _ := disk.Usage(parts[0].Mountpoint)
|