LingxinMeng 1 năm trước cách đây
mục cha
commit
5f44b81768
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      test/monitor/main/main.go

+ 1 - 1
test/monitor/main/main.go

@@ -66,7 +66,7 @@ func GetTop10CpuAndMem() ([]ProcessInfo, []ProcessInfo) {
 		return cpuPercent[sortedPidsCpu[i]] > cpuPercent[sortedPidsCpu[j]]
 	})
 	sort.Slice(sortedPidsMem, func(i, j int) bool {
-		return memPercent[sortedPidsCpu[i]] > memPercent[sortedPidsCpu[j]]
+		return memPercent[sortedPidsMem[i]] > memPercent[sortedPidsMem[j]]
 	})
 
 	// 输出前10个CPU占用率最高的进程名称