@Override public synchronized long getMaxValue() { return super.getMaxValue(); }
@Override public long getMax() { return histogram.getMaxValue(); }
public double getMaxLatency(TimeUnit unit) { return convert(histo.getMaxValue(), TimeUnit.NANOSECONDS, unit); }
private CommandLatency getMetric(Histogram histogram) { Map<Double, Long> percentiles = getPercentiles(histogram); TimeUnit timeUnit = options.targetUnit(); return new CommandLatency(timeUnit.convert(histogram.getMinValue(), TimeUnit.NANOSECONDS), timeUnit.convert( histogram.getMaxValue(), TimeUnit.NANOSECONDS), percentiles); }
/** * This is called periodically from the StatusThread. There's a single * StatusThread per Client process. We optionally serialize the interval to * log on this opportunity. * * @see com.yahoo.ycsb.measurements.OneMeasurement#getSummary() */ @Override public String getSummary() { Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); // we use the summary interval as the histogram file interval. if (histogramLogWriter != null) { histogramLogWriter.outputIntervalHistogram(intervalHistogram); } DecimalFormat d = new DecimalFormat("#.##"); return "[" + getName() + ": Count=" + intervalHistogram.getTotalCount() + ", Max=" + intervalHistogram.getMaxValue() + ", Min=" + intervalHistogram.getMinValue() + ", Avg=" + d.format(intervalHistogram.getMean()) + ", 90=" + d.format(intervalHistogram.getValueAtPercentile(90)) + ", 99=" + d.format(intervalHistogram.getValueAtPercentile(99)) + ", 99.9=" + d.format(intervalHistogram.getValueAtPercentile(99.9)) + ", 99.99=" + d.format(intervalHistogram.getValueAtPercentile(99.99)) + "]"; }
((Histogram) intervalHistogram).getValueAtPercentile(50.0) / config.outputValueUnitRatio, ((Histogram) intervalHistogram).getValueAtPercentile(90.0) / config.outputValueUnitRatio, ((Histogram) intervalHistogram).getMaxValue() / config.outputValueUnitRatio, accumulatedRegularHistogram.getValueAtPercentile(99.9) / config.outputValueUnitRatio, accumulatedRegularHistogram.getValueAtPercentile(99.99) / config.outputValueUnitRatio, accumulatedRegularHistogram.getMaxValue() / config.outputValueUnitRatio ); ((Histogram) movingWindowSumHistogram).getMaxValue() / config.outputValueUnitRatio );
exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean()); exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue()); exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue());
@UserAggregationResult public Map<String,Number> result() { long totalCount = values != null ? values.getTotalCount() : doubles.getTotalCount(); boolean empty = totalCount == 0; Map<String,Number> result = new LinkedHashMap<>(percentiles.size()+6); result.put("min",values != null ? (Number)values.getMinValue() : (Number)doubles.getMinValue()); result.put("minNonZero",values != null ? (Number)values.getMinNonZeroValue() : (Number)doubles.getMinNonZeroValue()); result.put("max",values != null ? (Number)values.getMaxValue() : (Number)doubles.getMaxValue()); result.put("total",totalCount); result.put("mean",values != null ? values.getMean() : doubles.getMean()); result.put("stdev",values != null ? values.getStdDeviation() : doubles.getStdDeviation()); for (Double percentile : percentiles) { if (percentile != null && !empty) { if (values != null) { result.put(percentile.toString(), values.getValueAtPercentile(percentile * 100D)); } else { result.put(percentile.toString(), doubles.getValueAtPercentile(percentile * 100D)); } } } return result; } }
public static DoubleHistogram toDoubleHistogram(Histogram source, int numberOfSignificantValueDigits) { DoubleHistogram doubles = new DoubleHistogram(numberOfSignificantValueDigits); // Do max value first, to avoid max value updates on each iteration: int otherMaxIndex = source.countsArrayIndex(source.getMaxValue()); long count = source.getCountAtIndex(otherMaxIndex); doubles.recordValueWithCount(source.valueFromIndex(otherMaxIndex), count); // Record the remaining values, up to but not including the max value: for (int i = 0; i < otherMaxIndex; i++) { count = source.getCountAtIndex(i); if (count > 0) { doubles.recordValueWithCount(source.valueFromIndex(i), count); } } return doubles; } }
@Override public long getMax() { return histogram.getMaxValue(); }
@Override public long getMax() { return histogram.getMaxValue(); }
@Override public Long getValue() { return histogram.getMaxValue(); } }
@Override public synchronized long getMaxValue() { return super.getMaxValue(); }
@Override public long getMax() { return histogram.getMaxValue(); }
@Override public long getMax() { return histogram.getMaxValue() * 1000; }
public static Map<String, String> createLatencyReportFast(Histogram histogram) { Map<String, String> fmt = new LinkedHashMap<>(); Arrays.stream(PERCENTILES).forEach(p -> { String formattedValue = formatLatencyValueAsTime((int) histogram.getValueAtPercentile(p)); fmt.put(p + "%", formattedValue); }); fmt.put("W", formatLatencyValueAsTime((int) histogram.getMaxValue())); return fmt; }
private CommandLatency getMetric(Histogram histogram) { Map<Double, Long> percentiles = getPercentiles(histogram); TimeUnit timeUnit = options.targetUnit(); return new CommandLatency(timeUnit.convert(histogram.getMinValue(), TimeUnit.NANOSECONDS), timeUnit.convert( histogram.getMaxValue(), TimeUnit.NANOSECONDS), percentiles); }
private static void printAggregatedStats() { Histogram reportHistogram = cumulativeRecorder.getIntervalHistogram(); log.info( "Aggregated latency stats --- Latency: mean: {} ms - med: {} - 95pct: {} - 99pct: {} - 99.9pct: {} - 99.99pct: {} - 99.999pct: {} - Max: {}", dec.format(reportHistogram.getMean() / 1000.0), dec.format(reportHistogram.getValueAtPercentile(50) / 1000.0), dec.format(reportHistogram.getValueAtPercentile(95) / 1000.0), dec.format(reportHistogram.getValueAtPercentile(99) / 1000.0), dec.format(reportHistogram.getValueAtPercentile(99.9) / 1000.0), dec.format(reportHistogram.getValueAtPercentile(99.99) / 1000.0), dec.format(reportHistogram.getValueAtPercentile(99.999) / 1000.0), dec.format(reportHistogram.getMaxValue() / 1000.0)); }
public static void printStats(final Histogram histogram) { System.out.printf( "Max = %d, Mean = %f, 99.9%% = %d%n", histogram.getMaxValue(), histogram.getMean(), histogram.getValueAtPercentile(99.9)); } }
private static void printAggregatedStats() { Histogram reportHistogram = cumulativeRecorder.getIntervalHistogram(); log.info( "Aggregated latency stats --- Latency: mean: {} ms - med: {} - 95pct: {} - 99pct: {} - 99.9pct: {} - 99.99pct: {} - 99.999pct: {} - Max: {}", dec.format(reportHistogram.getMean()), (long) reportHistogram.getValueAtPercentile(50), (long) reportHistogram.getValueAtPercentile(95), (long) reportHistogram.getValueAtPercentile(99), (long) reportHistogram.getValueAtPercentile(99.9), (long) reportHistogram.getValueAtPercentile(99.99), (long) reportHistogram.getValueAtPercentile(99.999), (long) reportHistogram.getMaxValue()); }