diff --git a/c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java b/c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java index b157e8294e..8534536430 100644 --- a/c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java +++ b/c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java @@ -228,7 +228,7 @@ public class C2HeartbeatFactory { // getSystemLoadAverage is not available in Windows, so we need to prevent to send invalid data if (systemLoadAverage >= 0) { - systemInfo.setCpuUtilization(systemLoadAverage / (double) osMXBean.getAvailableProcessors()); + systemInfo.setCpuLoadAverage(systemLoadAverage); } return systemInfo; diff --git a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java index 05c87cf2f3..cd07ef19b7 100644 --- a/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java +++ b/c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java @@ -45,6 +45,7 @@ public class SystemInfo implements Serializable { @ApiModelProperty private Double cpuUtilization; + private Double cpuLoadAverage; public String getMachineArch() { return machineArch; @@ -93,4 +94,12 @@ public class SystemInfo implements Serializable { public void setvCores(Integer vCores) { this.vCores = vCores; } + + public Double getCpuLoadAverage() { + return cpuLoadAverage; + } + + public void setCpuLoadAverage(Double cpuLoadAverage) { + this.cpuLoadAverage = cpuLoadAverage; + } }