mirror of https://github.com/apache/nifi.git
NIFI-11921 Set CPU Load Average for C2 Heartbeats
This closes #7584 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
cba6b00271
commit
f8d0d2f9b6
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue