Track exceptions
@@ -65,6 +65,7 @@ public class DeploymentMetricsMaintainer extends Maintainer {
Cursor cursor = slime.setArray();
pool.submit(() -> {
applicationList.parallelStream().forEach(application -> {
+ try {
Cursor applicationCursor = cursor.addObject();
applicationCursor.setString("applicationId", application.id().serializedForm());
Cursor applicationMetrics = applicationCursor.setObject("applicationMetrics");
@@ -76,6 +77,10 @@ public class DeploymentMetricsMaintainer extends Maintainer {
Cursor deploymentEntry = deploymentArray.addObject();
fillDeploymentMetrics(deploymentEntry, application, deployment);
}
+ } catch (Exception e) {
+ failures.incrementAndGet();
+ lastException.set(e);
+ }
});
});
pool.shutdown();
