public long getCountAddedInThisIterationStep() { return integerHistogramIterationValue.getCountAddedInThisIterationStep(); }
@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; }
/** * 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; }
public long getCountAddedInThisIterationStep() { return integerHistogramIterationValue.getCountAddedInThisIterationStep(); }
@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) { 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) { 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); } } }
@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 int size = toIntExact(histogram.getTotalCount()); final long[] values = new long[size]; int pos = 0; for(HistogramIterationValue value : histogram.recordedValues()) { long recordedValue = value.getValueIteratedTo(); long count = value.getCountAddedInThisIterationStep(); for(int i = 0; i < count; i++) { values[pos++] = recordedValue; } } return values; }
@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; } } if (i != vals.length) { throw new IllegalStateException(format("Total count was %d but iterating values produced is %d", histogram.getTotalCount(), vals.length)); } return vals; }
@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; }
@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; }
@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; }