mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 11:58:01 +08:00
feat 插件端新增虚拟内存和交互内存监控趋势
This commit is contained in:
parent
7c858c311f
commit
f815d46fd8
@ -92,6 +92,9 @@ public class OshiUtils {
|
||||
jsonObject.put("osCpuCores", processor.getLogicalProcessorCount());
|
||||
GlobalMemory globalMemory = OshiUtil.getMemory();
|
||||
jsonObject.put("osMoneyTotal", globalMemory.getTotal());
|
||||
VirtualMemory virtualMemory = globalMemory.getVirtualMemory();
|
||||
jsonObject.put("osSwapTotal", virtualMemory.getSwapTotal());
|
||||
jsonObject.put("osVirtualMax", virtualMemory.getVirtualMax());
|
||||
double[] systemLoadAverage = processor.getSystemLoadAverage(3);
|
||||
jsonObject.put("osLoadAverage", systemLoadAverage);
|
||||
FileSystem fileSystem = os.getFileSystem();
|
||||
@ -116,8 +119,14 @@ public class OshiUtils {
|
||||
GlobalMemory globalMemory = OshiUtil.getMemory();
|
||||
jsonObject.put("memory", NumberUtil.div(globalMemory.getTotal() - globalMemory.getAvailable(), globalMemory.getTotal(), 2) * 100);
|
||||
VirtualMemory virtualMemory = globalMemory.getVirtualMemory();
|
||||
jsonObject.put("swapMemory", NumberUtil.div(virtualMemory.getSwapUsed(), virtualMemory.getSwapTotal(), 2) * 100);
|
||||
jsonObject.put("virtualMemory", NumberUtil.div(virtualMemory.getVirtualInUse(), virtualMemory.getVirtualMax(), 2) * 100);
|
||||
long swapTotal = virtualMemory.getSwapTotal();
|
||||
if (swapTotal > 0) {
|
||||
jsonObject.put("swapMemory", NumberUtil.div(virtualMemory.getSwapUsed(), swapTotal, 2) * 100);
|
||||
}
|
||||
long virtualMax = virtualMemory.getVirtualMax();
|
||||
if (virtualMax > 0) {
|
||||
jsonObject.put("virtualMemory", NumberUtil.div(virtualMemory.getVirtualInUse(), virtualMax, 2) * 100);
|
||||
}
|
||||
//
|
||||
FileSystem fileSystem = OshiUtil.getOs().getFileSystem();
|
||||
List<OSFileStore> fileStores = fileSystem.getFileStores();
|
||||
|
@ -82,6 +82,14 @@ public class MachineNodeModel extends BaseGroupNameModel implements INodeInfo {
|
||||
* 总内存
|
||||
*/
|
||||
private Long osMoneyTotal;
|
||||
/**
|
||||
* 交互总内存
|
||||
*/
|
||||
private Long osSwapTotal;
|
||||
/**
|
||||
* 虚拟总内存
|
||||
*/
|
||||
private Long osVirtualMax;
|
||||
/**
|
||||
* 硬盘总大小
|
||||
*/
|
||||
|
@ -293,6 +293,8 @@ public class MachineNodeServer extends BaseDbService<MachineNodeModel> implement
|
||||
machineNodeModel.setOsCpuIdentifierName(jsonObject.getString("osCpuIdentifierName"));
|
||||
machineNodeModel.setOsCpuCores(jsonObject.getInteger("osCpuCores"));
|
||||
machineNodeModel.setOsMoneyTotal(jsonObject.getLong("osMoneyTotal"));
|
||||
machineNodeModel.setOsSwapTotal(jsonObject.getLong("osSwapTotal"));
|
||||
machineNodeModel.setOsVirtualMax(jsonObject.getLong("osVirtualMax"));
|
||||
machineNodeModel.setOsLoadAverage(CollUtil.join(jsonObject.getList("osLoadAverage", Double.class), StrUtil.COMMA));
|
||||
machineNodeModel.setOsFileStoreTotal(jsonObject.getLong("osFileStoreTotal"));
|
||||
});
|
||||
|
@ -20,3 +20,5 @@ DROP-TABLE,SYSTEMMONITORLOG,
|
||||
ADD,MACHINE_NODE_INFO,installId,String,50,,机器安装 id
|
||||
ADD,MACHINE_NODE_STAT_LOG,occupySwapMemory,Double,,,交互内存
|
||||
ADD,MACHINE_NODE_STAT_LOG,occupyVirtualMemory,Double,,,虚拟内存
|
||||
ADD,MACHINE_NODE_INFO,osSwapTotal,Long,,,虚拟总内存
|
||||
ADD,MACHINE_NODE_INFO,osVirtualMax,Long,,,交互总内存
|
||||
|
|
@ -121,8 +121,8 @@ export function generateNodeTopChart(data) {
|
||||
cpuItem.data.push(parseFloat(item.occupyCpu));
|
||||
diskItem.data.push(parseFloat(item.occupyDisk));
|
||||
memoryItem.data.push(parseFloat(item.occupyMemory));
|
||||
swapMemory.data.push(parseFloat(item.occupySwapMemory || -1));
|
||||
virtualMemory.data.push(parseFloat(item.occupyVirtualMemory || -1));
|
||||
swapMemory.data.push(parseFloat(item.occupySwapMemory || -0.1));
|
||||
virtualMemory.data.push(parseFloat(item.occupyVirtualMemory || -0.1));
|
||||
|
||||
scales.push(parseTime(item.monitorTime));
|
||||
}
|
||||
|
@ -49,6 +49,8 @@
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="CPU数">{{ machineInfo && machineInfo.osCpuCores }} </a-descriptions-item>
|
||||
<a-descriptions-item label="内存">{{ renderSize(machineInfo && machineInfo.osMoneyTotal) }} </a-descriptions-item>
|
||||
<a-descriptions-item label="虚拟内存">{{ renderSize(machineInfo && machineInfo.osVirtualMax) }} </a-descriptions-item>
|
||||
<a-descriptions-item label="交互内存">{{ renderSize(machineInfo && machineInfo.osSwapTotal) }} </a-descriptions-item>
|
||||
<a-descriptions-item label="硬盘">{{ renderSize(machineInfo && machineInfo.osFileStoreTotal) }} </a-descriptions-item>
|
||||
|
||||
<a-descriptions-item label="负载">{{ machineInfo && machineInfo.osLoadAverage }} </a-descriptions-item>
|
||||
@ -63,8 +65,7 @@
|
||||
<a-descriptions-item label="项目数">{{ machineInfo && machineInfo.jpomProjectCount }} </a-descriptions-item>
|
||||
<a-descriptions-item label="脚本数">{{ machineInfo && machineInfo.jpomScriptCount }} </a-descriptions-item>
|
||||
<a-descriptions-item label="网络延迟">{{ formatDuration(machineInfo && machineInfo.networkDelay) }} </a-descriptions-item>
|
||||
<a-descriptions-item></a-descriptions-item>
|
||||
<a-descriptions-item></a-descriptions-item>
|
||||
|
||||
<a-descriptions-item label="硬盘占用" :span="4">
|
||||
<a-progress
|
||||
:stroke-color="{
|
||||
|
Loading…
Reference in New Issue
Block a user