From 76f6fa284d304686b6dc62e8fbd4672c4e535059 Mon Sep 17 00:00:00 2001 From: fangshunjian Date: Fri, 21 Dec 2018 18:52:46 +0600 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=20cpu=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E4=BF=A1=E6=81=AF=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?cpu=E6=AF=8F=E4=B8=80=E6=A0=B8=E7=9A=84=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/nis/nmsclient/common/Contants.java | 12 ++++++++++-- src/com/nis/systeminfo/model/SystemInfo.java | 6 ++++-- 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();// 用户使用率累加