From 3ca9680b20a4e5b3c0aff65abbcf4faf3379cd3f Mon Sep 17 00:00:00 2001 From: LiuBodong Date: Sun, 11 Sep 2022 19:11:03 +0800 Subject: [PATCH] [Fix][Monitor]Monitor UI not show DisakAvailable and MemoryUsage correctly (#11870) --- .../apache/dolphinscheduler/common/model/MasterHeartBeat.java | 1 + .../apache/dolphinscheduler/common/model/WorkerHeartBeat.java | 1 + .../server/master/task/MasterHeartBeatTask.java | 2 ++ .../server/worker/task/WorkerHeartBeatTask.java | 2 ++ 4 files changed, 6 insertions(+) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/MasterHeartBeat.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/MasterHeartBeat.java index 95ece3522e..6ca51a4c29 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/MasterHeartBeat.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/MasterHeartBeat.java @@ -35,5 +35,6 @@ public class MasterHeartBeat implements HeartBeat { private double availablePhysicalMemorySize; private double maxCpuloadAvg; private double reservedMemory; + private double diskAvailable; private int processId; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerHeartBeat.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerHeartBeat.java index 4bb765d180..7980e9bbed 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerHeartBeat.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerHeartBeat.java @@ -36,6 +36,7 @@ public class WorkerHeartBeat implements HeartBeat { private double availablePhysicalMemorySize; private double maxCpuloadAvg; private double reservedMemory; + private double diskAvailable; private int serverStatus; private int processId; diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/task/MasterHeartBeatTask.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/task/MasterHeartBeatTask.java index 53b90b7370..a4c89b210a 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/task/MasterHeartBeatTask.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/task/MasterHeartBeatTask.java @@ -57,6 +57,8 @@ public class MasterHeartBeatTask extends BaseHeartBeatTask { .availablePhysicalMemorySize(OSUtils.availablePhysicalMemorySize()) .maxCpuloadAvg(masterConfig.getMaxCpuLoadAvg()) .reservedMemory(masterConfig.getReservedMemory()) + .memoryUsage(OSUtils.memoryUsage()) + .diskAvailable(OSUtils.diskAvailable()) .processId(processId) .build(); } diff --git a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java b/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java index 672135613a..d2a9ca008c 100644 --- a/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java +++ b/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java @@ -68,7 +68,9 @@ public class WorkerHeartBeatTask extends BaseHeartBeatTask { .loadAverage(loadAverage) .availablePhysicalMemorySize(availablePhysicalMemorySize) .maxCpuloadAvg(maxCpuLoadAvg) + .memoryUsage(OSUtils.memoryUsage()) .reservedMemory(reservedMemory) + .diskAvailable(OSUtils.diskAvailable()) .processId(processId) .workerHostWeight(workerConfig.getHostWeight()) .workerWaitingTaskCount(this.workerWaitingTaskCount.get())