summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangshunjian <[email protected]>2018-12-21 18:52:46 +0600
committerfangshunjian <[email protected]>2018-12-21 18:52:46 +0600
commit76f6fa284d304686b6dc62e8fbd4672c4e535059 (patch)
treeff61476deef144254f44586fc633f3f30c60abf7
parent48e8a81442f03d836825754f4d3626e3ac0cdb56 (diff)
1、增加 cpu性能信息是否显示cpu每一核的开关
-rw-r--r--src/com/nis/nmsclient/common/Contants.java12
-rw-r--r--src/com/nis/systeminfo/model/SystemInfo.java6
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/nis/nmsclient/common/Contants.java b/src/com/nis/nmsclient/common/Contants.java
index a62eb2d..281fdb7 100644
--- a/src/com/nis/nmsclient/common/Contants.java
+++ b/src/com/nis/nmsclient/common/Contants.java
@@ -141,6 +141,11 @@ public class Contants {
*/
public static final int STARTUP_SLEEP_SECOND;
+ /**
+ * 是否CPU監測信息性能描述顯示詳細每一核的信息
+ */
+ public static final boolean DESC_CPU_DETAIL;
+
static{
SYSTEM_PATH = SysConfig.getSystemDir();
@@ -253,8 +258,11 @@ public class Contants {
* 启动时最大 暂停时间,为了缓解一次启动多个nc ,dc无法处理的情况
* 单位:s
*/
- STARTUP_SLEEP_SECOND = SysConfig.getIntegerVal("startup.sleep.second", "10");
-
+ STARTUP_SLEEP_SECOND = SysConfig.getIntegerVal("startup.sleep.second", "60");
+ /**
+ * 1:cpu desc info contain each cpu core,0:no contain
+ */
+ DESC_CPU_DETAIL = (SysConfig.getIntegerVal("desc.cpu.detail", "0")==1);
// 初始化创建文件夹
if(!new File(localDetecConfPath).exists()){
new File(localDetecConfPath).mkdirs();
diff --git a/src/com/nis/systeminfo/model/SystemInfo.java b/src/com/nis/systeminfo/model/SystemInfo.java
index 0a2d42f..60837c2 100644
--- a/src/com/nis/systeminfo/model/SystemInfo.java
+++ b/src/com/nis/systeminfo/model/SystemInfo.java
@@ -121,8 +121,10 @@ public class SystemInfo
sb.append(cpuInfos[i].getMhz());// 主频
detectInfo.getDetailDatas().add(sb.toString().replace("%", ""));
// sb2.append(Contants.DETEC_STATE_INFO_FORMATE_POINT+"cpu" + i + " 主频" + cpuInfos[i].getMhz() + "MHz,使用率 "
- sb2.append(Contants.DETEC_STATE_INFO_FORMATE_POINT+"cpu" + i + " i18n_client.SystemInfo.mhz_n81i" + cpuInfos[i].getMhz() + "MHz,i18n_client.SystemInfo.shiyonglv_n81i "
- + CpuPerc.format(cpuList[i].getCombined()) + "; ");
+ if(Contants.DESC_CPU_DETAIL) {
+ sb2.append(Contants.DETEC_STATE_INFO_FORMATE_POINT+"cpu" + i + " i18n_client.SystemInfo.mhz_n81i" + cpuInfos[i].getMhz() + "MHz,i18n_client.SystemInfo.shiyonglv_n81i "
+ + CpuPerc.format(cpuList[i].getCombined()) + "; ");
+ }
// CPU总体信息情况
userCpuPerc += cpuList[i].getUser();// 用户使用率累加