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
1 changed files with 10 additions and 3 deletions

View File

@ -152,12 +152,20 @@ class Insights {
void writeMetricsForManagedSystems() {
systems.forEach((systemId, system) -> influxClient.writeManagedSystem(system));
try {
systems.forEach((systemId, system) -> influxClient.writeManagedSystem(system));
} catch (NullPointerException npe) {
log.warn("writeMetricsForManagedSystems() - NPE: " + npe.toString());
}
}
void writeMetricsForLogicalPartitions() {
partitions.forEach((partitionId, partition) -> influxClient.writeLogicalPartition(partition));
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();