|
@@ -215,15 +215,14 @@ public class Server {
|
|
|
for (int i = 0; i < gpuInfoList.size(); i++) {
|
|
|
Gpu gpu = new Gpu();
|
|
|
System.out.println("\nGPU #" + i + " 信息:");
|
|
|
- for (Map<String, String> stringStringMap : gpuInfoList) {
|
|
|
- gpu.setName(stringStringMap.get("名称"));
|
|
|
- gpu.setGpuMemory(stringStringMap.get("总显存"));
|
|
|
- gpu.setUseMemory(stringStringMap.get("显存使用"));
|
|
|
- gpu.setUsed(stringStringMap.get("使用率"));
|
|
|
- gpu.setTemperature(stringStringMap.get("温度"));
|
|
|
- gpu.setPower(stringStringMap.get("功耗"));
|
|
|
- gpuList.add(gpu);
|
|
|
- }
|
|
|
+ Map<String, String> stringStringMap = gpuInfoList.get(i);
|
|
|
+ gpu.setName(stringStringMap.get("名称"));
|
|
|
+ gpu.setGpuMemory(stringStringMap.get("总显存"));
|
|
|
+ gpu.setUseMemory(stringStringMap.get("显存使用"));
|
|
|
+ gpu.setUsed(stringStringMap.get("使用率"));
|
|
|
+ gpu.setTemperature(stringStringMap.get("温度"));
|
|
|
+ gpu.setPower(stringStringMap.get("功耗"));
|
|
|
+ gpuList.add(gpu);
|
|
|
gpuInfoList.get(i).forEach((key, value) ->
|
|
|
System.out.println(" " + key + ": " + value)
|
|
|
);
|