public double getValueIteratedFrom() { return integerHistogramIterationValue.getValueIteratedFrom() * integerHistogramIterationValue.getIntegerToDoubleValueConversionRatio(); }
public double getValueIteratedFrom() { return integerHistogramIterationValue.getValueIteratedFrom() * integerHistogramIterationValue.getIntegerToDoubleValueConversionRatio(); }
@Managed(description = "Per-bucket counts") public Map<Double, Long> getCounts() { Map<Double, Long> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = (entry.getValueIteratedTo() + entry.getValueIteratedFrom()) / 2.0; result.put(round(median / (double) TimeUnit.MILLISECONDS.toNanos(1), 2), entry.getCountAddedInThisIterationStep()); } return result; }
@Managed(description = "Per-bucket counts") public Map<Double, Long> getCounts() { Map<Double, Long> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = (entry.getValueIteratedTo() + entry.getValueIteratedFrom()) / 2.0; result.put(round(median / (double) TimeUnit.MILLISECONDS.toNanos(1), 2), entry.getCountAddedInThisIterationStep()); } return result; }
@Managed(description = "Per-bucket total pause time in s") public Map<Double, Double> getSums() { long previous = 0; Map<Double, Double> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = (entry.getValueIteratedTo() + entry.getValueIteratedFrom()) / 2.0; long current = entry.getTotalValueToThisValue(); result.put(round(median / TimeUnit.MILLISECONDS.toNanos(1), 2), round((current - previous) * 1.0 / TimeUnit.SECONDS.toNanos(1), 2)); previous = current; } return result; }
@Managed(description = "Per-bucket total pause time in s") public Map<Double, Double> getSums() { long previous = 0; Map<Double, Double> result = new TreeMap<>(); for (HistogramIterationValue entry : snapshot.get().logarithmicBucketValues(TimeUnit.MILLISECONDS.toNanos(1), 2)) { double median = (entry.getValueIteratedTo() + entry.getValueIteratedFrom()) / 2.0; long current = entry.getTotalValueToThisValue(); result.put(round(median / TimeUnit.MILLISECONDS.toNanos(1), 2), round((current - previous) * 1.0 / TimeUnit.SECONDS.toNanos(1), 2)); previous = current; } return result; }
public static SimulatorHistogramDataSet getHistogramDataSet(Histogram histogram, int accuracy, double scalingPercentile) { if (histogram == null) { return null; } SimulatorHistogramDataSet histogramDataSet = new SimulatorHistogramDataSet("key"); histogramDataSet.setAdjustForBinSize(false); for (HistogramIterationValue value : histogram.linearBucketValues(accuracy)) { int values = (int) value.getCountAddedInThisIterationStep(); if (values > 0) { long lowerBound = value.getValueIteratedFrom(); long upperBound = value.getValueIteratedTo(); SimpleHistogramBin bin = new SimpleHistogramBin(lowerBound, upperBound, true, false); bin.setItemCount(values); histogramDataSet.addBin(bin); } } histogramDataSet.setAutoScaleValue(histogram.getValueAtPercentile(scalingPercentile * PERCENTILE_FACTOR)); return histogramDataSet; } }
private static SimpleHistogramDataSetContainer calcSingleProbeDataSet(HdrLatencyDistributionResult probeData, long accuracy, double scalingPercentile) { SimpleHistogramDataSetContainer histogramDataSet = new SimpleHistogramDataSetContainer("key"); histogramDataSet.setAdjustForBinSize(false); Histogram histogram = probeData.getHistogram(); for (HistogramIterationValue value : histogram.linearBucketValues(accuracy)) { int values = (int) value.getCountAddedInThisIterationStep(); if (values > 0) { long lowerBound = value.getValueIteratedFrom(); long upperBound = value.getValueIteratedTo(); SimpleHistogramBin bin = new SimpleHistogramBin(lowerBound, upperBound, true, false); bin.setItemCount(values); histogramDataSet.addBin(bin); } } histogramDataSet.setAutoScaleValue(histogram.getValueAtPercentile(scalingPercentile * 100)); return histogramDataSet; }