mirror of https://github.com/elunez/eladmin
commit
28a328a339
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
@ -276,7 +276,8 @@ public class GenUtil {
|
|||
// 主键存在字典
|
||||
if (StringUtils.isNotBlank(column.getDictName())) {
|
||||
genMap.put("hasDict", true);
|
||||
dicts.add(column.getDictName());
|
||||
if(!dicts.contains(column.getDictName()))
|
||||
dicts.add(column.getDictName());
|
||||
}
|
||||
|
||||
// 存储字段类型
|
||||
|
|
|
@ -148,9 +148,15 @@ public class MonitorServiceImpl implements MonitorService {
|
|||
cpuInfo.put("logic", processor.getLogicalProcessorCount() + "个逻辑CPU");
|
||||
// CPU信息
|
||||
long[] prevTicks = processor.getSystemCpuLoadTicks();
|
||||
// 等待1秒...
|
||||
Util.sleep(1000);
|
||||
// 默认等待300毫秒...
|
||||
long time = 300;
|
||||
Util.sleep(time);
|
||||
long[] ticks = processor.getSystemCpuLoadTicks();
|
||||
while (Arrays.toString(prevTicks).equals(Arrays.toString(ticks)) && time < 1000){
|
||||
time += 25;
|
||||
Util.sleep(25);
|
||||
ticks = processor.getSystemCpuLoadTicks();
|
||||
}
|
||||
long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()];
|
||||
long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()];
|
||||
long sys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()];
|
||||
|
|
Loading…
Reference in New Issue