mirror of https://github.com/apache/nifi.git
NIFI-8317 heap and non_heap usage Prometheus metrics now return -1.0 when undefined.
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #4920
This commit is contained in:
parent
02ea103c6b
commit
ee1386db02
|
@ -139,12 +139,14 @@ public class JmxJvmMetrics implements JvmMetrics {
|
|||
|
||||
@Override
|
||||
public double heapUsage() {
|
||||
return (Double) getMetric(MEMORY_HEAP_USAGE);
|
||||
double usage = (Double) getMetric(MEMORY_HEAP_USAGE);
|
||||
return usage < 0 ? -1.0 : usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double nonHeapUsage() {
|
||||
return (Double) getMetric(MEMORY_NON_HEAP_USAGE);
|
||||
double usage = (Double) getMetric(MEMORY_NON_HEAP_USAGE);
|
||||
return usage < 0 ? -1.0 : usage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue