use of org.HdrHistogram.HistogramIterationValue in project quasar by puniverse.
the class HistogramSnapshot method getValues.
@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;
}
use of org.HdrHistogram.HistogramIterationValue in project grpc-java by grpc.
the class AsyncClient method merge.
private static Histogram merge(List<Histogram> histograms) {
Histogram merged = new Histogram(HISTOGRAM_MAX_VALUE, HISTOGRAM_PRECISION);
for (Histogram histogram : histograms) {
for (HistogramIterationValue value : histogram.allValues()) {
long latency = value.getValueIteratedTo();
long count = value.getCountAtValueIteratedTo();
merged.recordValueWithCount(latency, count);
}
}
return merged;
}
Aggregations