chore: remove empty snapshots
@@ -28,6 +28,8 @@ public String getMetrics() {
HistogramSnapshot snapshot = k.takeSnapshot();
long count = snapshot.count();
+
+ if (count > 0) {
double throughput = (count / (double) DisplayMetricsMonitor.captureDuration.toMillis());
builder.append(k.getId().getName());
builder.append(" : ");
@@ -35,8 +37,8 @@ public String getMetrics() {
builder.append(Double.isNaN(throughput) ? "NAN" : String.format("%,10.4f", throughput)).append(" /s");
builder.append(" mean: ").append(String.format("%,10.4f", k.mean(TimeUnit.MILLISECONDS))).append(" ms");
builder.append(" max: ").append(String.format("%,10.4f", k.max(TimeUnit.MILLISECONDS))).append(" ms");
-
builder.append("\n");
+ }
});
return builder.toString();
}
