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