|
@@ -156,8 +156,8 @@ public class Server {
|
|
long rxRate = (stats2.rxBytes - stats1.rxBytes) * 8; // 比特/秒
|
|
long rxRate = (stats2.rxBytes - stats1.rxBytes) * 8; // 比特/秒
|
|
long txRate = (stats2.txBytes - stats1.txBytes) * 8; // 比特/秒
|
|
long txRate = (stats2.txBytes - stats1.txBytes) * 8; // 比特/秒
|
|
netWork.setNetworkName(interfaceName);
|
|
netWork.setNetworkName(interfaceName);
|
|
- netWork.setNetworkUp(txRate);
|
|
|
|
- netWork.setNetworkDown(rxRate);
|
|
|
|
|
|
+ netWork.setNetworkUp(formatRate(rxRate));
|
|
|
|
+ netWork.setNetworkDown(formatRate(txRate));
|
|
netWorkList.add(netWork);
|
|
netWorkList.add(netWork);
|
|
System.out.printf("\n网络速率 (%s):\n 下行: %s\n 上行: %s\n",
|
|
System.out.printf("\n网络速率 (%s):\n 下行: %s\n 上行: %s\n",
|
|
interfaceName,
|
|
interfaceName,
|
|
@@ -378,7 +378,7 @@ public class Server {
|
|
Map<Integer, Double> cpuSpeeds = getCpuSpeeds();
|
|
Map<Integer, Double> cpuSpeeds = getCpuSpeeds();
|
|
if (!cpuSpeeds.isEmpty()) {
|
|
if (!cpuSpeeds.isEmpty()) {
|
|
for (Integer socket : cpuSpeeds.keySet()) {
|
|
for (Integer socket : cpuSpeeds.keySet()) {
|
|
- cpuList.get(socket).setSpeed(cpuSpeeds.get(socket));
|
|
|
|
|
|
+ cpuList.get(socket).setSpeed(Arith.round(cpuSpeeds.get(socket),2));
|
|
System.out.printf("CPU插槽 %d 整体速度: %.2f GHz\n", socket, cpuSpeeds.get(socket));
|
|
System.out.printf("CPU插槽 %d 整体速度: %.2f GHz\n", socket, cpuSpeeds.get(socket));
|
|
}
|
|
}
|
|
}
|
|
}
|