From 69617042b13f24111e7d83f09f6161ed532becdb Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 22 Nov 2022 18:11:43 -0600 Subject: [PATCH] minor fixes on PR --- .../engine/core/lifecycle/ScenarioResult.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/ScenarioResult.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/ScenarioResult.java index 53ef887e6..54bf4d007 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/ScenarioResult.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/ScenarioResult.java @@ -149,14 +149,14 @@ public class ScenarioResult { StringBuilder sb = new StringBuilder(); ActivityMetrics.getMetricRegistry().getMetrics().forEach((k, v) -> { - if (v instanceof Counting) { - long count = ((Counting) v).getCount(); + if (v instanceof Counting counting) { + long count = counting.getCount(); if (count > 0) { NBMetricsSummary.summarize(sb, k, v); } - } else if (v instanceof Gauge) { - Object value = ((Gauge) v).getValue(); - if (value != null && value instanceof Number n) { + } else if (v instanceof Gauge gauge) { + Object value = gauge.getValue(); + if (value instanceof Number n) { if (n.doubleValue() != 0) { NBMetricsSummary.summarize(sb, k, v); }