public double getValueIteratedTo() { return integerHistogramIterationValue.getValueIteratedTo() * integerHistogramIterationValue.getIntegerToDoubleValueConversionRatio(); }
@Override public void dump(OutputStream output) { PrintWriter p = null; try { p = new PrintWriter(new OutputStreamWriter(output, UTF_8)); for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } catch (Exception e) { if(p != null) p.close(); logger.error("Exception:", e); } } }
@Override public long[] getValues() { long[] vals = new long[(int) histogram.getTotalCount()]; int i = 0; for (HistogramIterationValue value : histogram.recordedValues()) { long val = value.getValueIteratedTo(); for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { vals[i] = val; i++; } } if (i != vals.length) { throw new IllegalStateException( "Total count was " + histogram.getTotalCount() + " but iterating values produced " + vals.length); } return vals; }
toHistogram.recordValueWithCountAndExpectedInterval(v.getValueIteratedTo(), v.getCountAtValueIteratedTo(), expectedIntervalBetweenValueSamples);
v.getValueIteratedTo() * getIntegerToDoubleValueConversionRatio(), v.getCountAtValueIteratedTo(), expectedIntervalBetweenValueSamples);
if (iterationValue.getPercentileLevelIteratedTo() != 100.0D) { printStream.format(Locale.US, percentileFormatString, iterationValue.getValueIteratedTo() / outputValueUnitScalingRatio, iterationValue.getPercentileLevelIteratedTo()/100.0D, iterationValue.getTotalCountToThisValue(), } else { printStream.format(Locale.US, lastLinePercentileFormatString, iterationValue.getValueIteratedTo() / outputValueUnitScalingRatio, iterationValue.getPercentileLevelIteratedTo()/100.0D, iterationValue.getTotalCountToThisValue());
/** * Get the computed standard deviation of all recorded values in the histogram * * @return the standard deviation (in value units) of the histogram data */ public double getStdDeviation() { if (getTotalCount() == 0) { return 0.0; } final double mean = getMean(); double geometric_deviation_total = 0.0; recordedValuesIterator.reset(); while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); double deviation = (medianEquivalentValue(iterationValue.getValueIteratedTo()) * 1.0) - mean; geometric_deviation_total += (deviation * deviation) * iterationValue.getCountAddedInThisIterationStep(); } double std_deviation = Math.sqrt(geometric_deviation_total / getTotalCount()); return std_deviation; }
/** * Get the computed mean value of all recorded values in the histogram * * @return the mean value (in value units) of the histogram data */ public double getMean() { if (getTotalCount() == 0) { return 0.0; } recordedValuesIterator.reset(); double totalValue = 0; while (recordedValuesIterator.hasNext()) { HistogramIterationValue iterationValue = recordedValuesIterator.next(); totalValue += medianEquivalentValue(iterationValue.getValueIteratedTo()) * (double) iterationValue.getCountAtValueIteratedTo(); } return (totalValue * 1.0) / getTotalCount(); }
for (HistogramIterationValue v : totalHistogram.recordedValues()) { int value; if (v.getValueIteratedTo() > (long)Integer.MAX_VALUE) { value = Integer.MAX_VALUE; } else { value = (int)v.getValueIteratedTo();
long valueIteratedTo = value.getValueIteratedTo(); if (that.getCountAtValue(valueIteratedTo) != countAtValueIteratedTo) { return false;
public double getValueIteratedTo() { return integerHistogramIterationValue.getValueIteratedTo() * integerHistogramIterationValue.getIntegerToDoubleValueConversionRatio(); }
@Override public void dump(OutputStream output) { try (PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8))) { for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } } }
@Override public void dump(OutputStream output) { PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8)); for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } }
@Override public void dump(OutputStream output) { try (PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8))) { for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } }
@Override public void dump(OutputStream output) { PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8)); for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) p.printf("%d%n", value.getValueIteratedTo()); } } }
@Override public void dump(OutputStream output) { try (PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8))) { for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } }
@Override public void dump(OutputStream output) { PrintWriter p = new PrintWriter(new OutputStreamWriter(output, UTF_8)); for (HistogramIterationValue value : histogram.recordedValues()) { for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) { p.printf("%d%n", value.getValueIteratedTo()); } } } }
@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; }
@Override public long[] getValues() { final long[] vals = new long[(int) histogram.getTotalCount()]; int i = 0; for (HistogramIterationValue value : histogram.recordedValues()) { long val = value.getValueIteratedTo(); for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) vals[i++] = val; } if (i != vals.length) throw new IllegalStateException("Total count was " + histogram.getTotalCount() + " but iterating values produced " + vals.length); return vals; }