Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public OneMeasurementHdrHistogram(String name, Properties props) {
* Using {@link Recorder} to support concurrent updates to histogram.
*/
public void measure(long latencyInMicros) {
histogram.recordValue(latencyInMicros);
// sct consumes hdr histograms expecting those to be in nanoseconds, so we adjust here.
histogram.recordValue(latencyInMicros * 1000);
}

/**
Expand All @@ -130,13 +131,14 @@ public void exportMeasurements(MeasurementsExporter exporter) throws IOException
log.close();
}
exporter.write(getName(), "Operations", totalHistogram.getTotalCount());
exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean());
exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue());
exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue());
// We need to divide by 1000 to convert back to micros for reporting, since we multiplied by 1000 when recording to convert from micros to nanos.
exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean() / 1000);
exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue() / 1000);
exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue() / 1000);

for (Double percentile : percentiles) {
exporter.write(getName(), ordinal(percentile) + "PercentileLatency(us)",
totalHistogram.getValueAtPercentile(percentile));
totalHistogram.getValueAtPercentile(percentile) / 1000);
}

exportStatusCounts(exporter);
Expand Down
Loading