/** * Output an interval histogram, with the given timestamp information, and the [optional] tag * associated with the histogram. (note that the specified timestamp information will be used, * and the timestamp information in the actual histogram will be ignored). * The max value in the histogram will be reported scaled down by a default maxValueUnitRatio of * 1,000,000 (which is the msec : nsec ratio). Caller should use the direct form specifying * maxValueUnitRatio some other ratio is needed for the max value output. * @param startTimeStampSec The start timestamp to log with the interval histogram, in seconds. * @param endTimeStampSec The end timestamp to log with the interval histogram, in seconds. * @param histogram The interval histogram to log. */ public void outputIntervalHistogram(final double startTimeStampSec, final double endTimeStampSec, final EncodableHistogram histogram) { outputIntervalHistogram(startTimeStampSec, endTimeStampSec, histogram, 1000000.0); }
/** * Output an interval histogram, using the start/end timestamp indicated in the histogram, * and the [optional] tag associated with the histogram. * The histogram start and end timestamps are assumed to be in msec units. Logging will be * in seconds, realtive by a base time (if set via {@link org.HdrHistogram.HistogramLogWriter#setBaseTime}). * The default base time is 0. * <p> * By covention, histogram start/end time are generally stamped with absolute times in msec * since the epoch. For logging with absolute time stamps, the base time would remain zero. For * logging with relative time stamps (time since a start point), the base time should be set * with {@link org.HdrHistogram.HistogramLogWriter#setBaseTime}. * <p> * The max value in the histogram will be reported scaled down by a default maxValueUnitRatio of * 1,000,000 (which is the msec : nsec ratio). Caller should use the direct form specifying * maxValueUnitRatio if some other ratio is needed for the max value output. * @param histogram The interval histogram to log. */ public void outputIntervalHistogram(final EncodableHistogram histogram) { outputIntervalHistogram((histogram.getStartTimeStamp() - baseTime)/1000.0, (histogram.getEndTimeStamp() - baseTime)/1000.0, histogram); }
/** * 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)) + "]"; }
histogramLogWriter.outputIntervalHistogram(intervalHistogram);
/** * Write the last results via the log writer. * @param writer the log writer to use */ public void write(HistogramLogWriter writer) { writer.outputIntervalHistogram(lastHistogram); }
/** * Output an interval histogram, with the given timestamp information, and the [optional] tag * associated with the histogram. (note that the specified timestamp information will be used, * and the timestamp information in the actual histogram will be ignored). * The max value in the histogram will be reported scaled down by a default maxValueUnitRatio of * 1,000,000 (which is the msec : nsec ratio). Caller should use the direct form specifying * maxValueUnitRatio some other ratio is needed for the max value output. * @param startTimeStampSec The start timestamp to log with the interval histogram, in seconds. * @param endTimeStampSec The end timestamp to log with the interval histogram, in seconds. * @param histogram The interval histogram to log. */ public void outputIntervalHistogram(final double startTimeStampSec, final double endTimeStampSec, final EncodableHistogram histogram) { outputIntervalHistogram(startTimeStampSec, endTimeStampSec, histogram, 1000000.0); }
@Override public void run() { for (WriterTarget target : targets) { writer.outputIntervalHistogram(target.histoProvider.getNextHdrDeltaHistogram()); } lastRunTime = System.currentTimeMillis(); }
/** * Output an interval histogram, using the start/end timestamp indicated in the histogram, * and the [optional] tag associated with the histogram. * The histogram start and end timestamps are assumed to be in msec units. Logging will be * in seconds, realtive by a base time (if set via {@link org.HdrHistogram.HistogramLogWriter#setBaseTime}). * The default base time is 0. * <p> * By covention, histogram start/end time are generally stamped with absolute times in msec * since the epoch. For logging with absolute time stamps, the base time would remain zero. For * logging with relative time stamps (time since a start point), the base time should be set * with {@link org.HdrHistogram.HistogramLogWriter#setBaseTime}. * <p> * The max value in the histogram will be reported scaled down by a default maxValueUnitRatio of * 1,000,000 (which is the msec : nsec ratio). Caller should use the direct form specifying * maxValueUnitRatio if some other ratio is needed for the max value output. * @param histogram The interval histogram to log. */ public void outputIntervalHistogram(final EncodableHistogram histogram) { outputIntervalHistogram((histogram.getStartTimeStamp() - baseTime)/1000.0, (histogram.getEndTimeStamp() - baseTime)/1000.0, histogram); }
void writeStatsToFile(long epochTime, String timestamp) { performanceLogWriter.write( epochTime, timestamp, totalOperationCount, intervalOperationCount, intervalThroughput, 0, 0); for (Map.Entry<String, Histogram> histogramEntry : intervalHistogramMap.entrySet()) { String probeName = histogramEntry.getKey(); HistogramLogWriter histogramLogWriter = histogramLogWriterMap.get(probeName); if (histogramLogWriter == null) { histogramLogWriter = createHistogramLogWriter( testContainer.getTestCase().getId(), probeName, testStartedTimestamp); histogramLogWriterMap.put(probeName, histogramLogWriter); } Histogram intervalHistogram = histogramEntry.getValue(); intervalHistogram.setStartTimeStamp(previousWriteToFile); intervalHistogram.setEndTimeStamp(epochTime); histogramLogWriter.outputIntervalHistogram(intervalHistogram); } previousWriteToFile = epochTime; }
/** * @return a copy of the accumulated state since the reservoir last had a snapshot */ private synchronized Histogram getDataSinceLastSnapshotAndUpdate() { intervalHistogram = recorder.getIntervalHistogram(intervalHistogram); long intervalHistogramStartTime = intervalHistogramEndTime; intervalHistogramEndTime = System.currentTimeMillis(); intervalHistogram.setTag(metricName); intervalHistogram.setStartTimeStamp(intervalHistogramStartTime); intervalHistogram.setEndTimeStamp(intervalHistogramEndTime); lastHistogram = intervalHistogram.copy(); lastHistogram.setTag(metricName); if (writer!=null) { writer.outputIntervalHistogram(lastHistogram); } return lastHistogram; }
dec.format(reportHistogram.getValueAtPercentile(99.99) / 1000.0)); histogramLogWriter.outputIntervalHistogram(reportHistogram); reportHistogram.reset();
dec.format(reportHistogram.getMaxValue() / 1000.0)); histogramLogWriter.outputIntervalHistogram(reportHistogram); reportHistogram.reset();
writer.outputIntervalHistogram(merged);