From 2c66bc652b3e768975a5e8bf08855c40fcf9b2f9 Mon Sep 17 00:00:00 2001 From: Jiongxin Liu Date: Mon, 26 Jun 2017 17:02:47 -0400 Subject: [PATCH] [core] Export totalHistogram for HdrHistogram measurement Signed-off-by: Chris Larsen --- .../measurements/OneMeasurementHdrHistogram.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java index aff6acf0..28c284dc 100644 --- a/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java +++ b/core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java @@ -19,6 +19,7 @@ package com.yahoo.ycsb.measurements; import com.yahoo.ycsb.measurements.exporter.MeasurementsExporter; import org.HdrHistogram.Histogram; +import org.HdrHistogram.HistogramIterationValue; import org.HdrHistogram.HistogramLogWriter; import org.HdrHistogram.Recorder; @@ -112,6 +113,18 @@ public class OneMeasurementHdrHistogram extends OneMeasurement { } exportStatusCounts(exporter); + + // also export totalHistogram + for (HistogramIterationValue v : totalHistogram.recordedValues()) { + int value; + if (v.getValueIteratedTo() > (long)Integer.MAX_VALUE) { + value = Integer.MAX_VALUE; + } else { + value = (int)v.getValueIteratedTo(); + } + + exporter.write(getName(), Integer.toString(value), (double)v.getCountAtValueIteratedTo()); + } } /**