[Fix][Monitor]Monitor UI not show DisakAvailable and MemoryUsage correctly (#11870)

This commit is contained in:
LiuBodong 2022-09-11 19:11:03 +08:00 committed by GitHub
parent c3a8dd5ca7
commit 3ca9680b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

View File

@ -35,5 +35,6 @@ public class MasterHeartBeat implements HeartBeat {
private double availablePhysicalMemorySize; private double availablePhysicalMemorySize;
private double maxCpuloadAvg; private double maxCpuloadAvg;
private double reservedMemory; private double reservedMemory;
private double diskAvailable;
private int processId; private int processId;
} }

View File

@ -36,6 +36,7 @@ public class WorkerHeartBeat implements HeartBeat {
private double availablePhysicalMemorySize; private double availablePhysicalMemorySize;
private double maxCpuloadAvg; private double maxCpuloadAvg;
private double reservedMemory; private double reservedMemory;
private double diskAvailable;
private int serverStatus; private int serverStatus;
private int processId; private int processId;

View File

@ -57,6 +57,8 @@ public class MasterHeartBeatTask extends BaseHeartBeatTask<MasterHeartBeat> {
.availablePhysicalMemorySize(OSUtils.availablePhysicalMemorySize()) .availablePhysicalMemorySize(OSUtils.availablePhysicalMemorySize())
.maxCpuloadAvg(masterConfig.getMaxCpuLoadAvg()) .maxCpuloadAvg(masterConfig.getMaxCpuLoadAvg())
.reservedMemory(masterConfig.getReservedMemory()) .reservedMemory(masterConfig.getReservedMemory())
.memoryUsage(OSUtils.memoryUsage())
.diskAvailable(OSUtils.diskAvailable())
.processId(processId) .processId(processId)
.build(); .build();
} }

View File

@ -68,7 +68,9 @@ public class WorkerHeartBeatTask extends BaseHeartBeatTask<WorkerHeartBeat> {
.loadAverage(loadAverage) .loadAverage(loadAverage)
.availablePhysicalMemorySize(availablePhysicalMemorySize) .availablePhysicalMemorySize(availablePhysicalMemorySize)
.maxCpuloadAvg(maxCpuLoadAvg) .maxCpuloadAvg(maxCpuLoadAvg)
.memoryUsage(OSUtils.memoryUsage())
.reservedMemory(reservedMemory) .reservedMemory(reservedMemory)
.diskAvailable(OSUtils.diskAvailable())
.processId(processId) .processId(processId)
.workerHostWeight(workerConfig.getHostWeight()) .workerHostWeight(workerConfig.getHostWeight())
.workerWaitingTaskCount(this.workerWaitingTaskCount.get()) .workerWaitingTaskCount(this.workerWaitingTaskCount.get())