Quick fix, catch null exceptions when getting metrics data.

This commit is contained in:
Mark Nellemann 2020-10-19 12:00:03 +02:00
parent 350ff8c354
commit 27468b2637

View file

@ -152,12 +152,20 @@ class Insights {
void writeMetricsForManagedSystems() {
try {
systems.forEach((systemId, system) -> influxClient.writeManagedSystem(system));
} catch (NullPointerException npe) {
log.warn("writeMetricsForManagedSystems() - NPE: " + npe.toString());
}
}
void writeMetricsForLogicalPartitions() {
try {
partitions.forEach((partitionId, partition) -> influxClient.writeLogicalPartition(partition));
} catch (NullPointerException npe) {
log.warn("writeMetricsForLogicalPartitions() - NPE: " + npe.toString());
}
}
@ -174,7 +182,6 @@ class Insights {
Runtime.getRuntime().addShutdownHook(shutdownHook);
do {
try {
getMetricsForSystems();
getMetricsForPartitions();