1、增加 cpu性能信息是否显示cpu每一核的开关

This commit is contained in:
fangshunjian
2018-12-21 18:52:46 +06:00
parent 48e8a81442
commit 76f6fa284d
2 changed files with 14 additions and 4 deletions

View File

@@ -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();

View File

@@ -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() + "MHzi18n_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() + "MHzi18n_client.SystemInfo.shiyonglv_n81i "
+ CpuPerc.format(cpuList[i].getCombined()) + "; ");
}
// CPU总体信息情况
userCpuPerc += cpuList[i].getUser();// 用户使用率累加