本文整理汇总了Java中org.HdrHistogram.HistogramIterationValue.getValueIteratedTo方法的典型用法代码示例。如果您正苦于以下问题:Java HistogramIterationValue.getValueIteratedTo方法的具体用法?Java HistogramIterationValue.getValueIteratedTo怎么用?Java HistogramIterationValue.getValueIteratedTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.HdrHistogram.HistogramIterationValue
的用法示例。
在下文中一共展示了HistogramIterationValue.getValueIteratedTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValues
import org.HdrHistogram.HistogramIterationValue; //导入方法依赖的package包/类
@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;
}
示例2: contains
import org.HdrHistogram.HistogramIterationValue; //导入方法依赖的package包/类
private boolean contains(Histogram histogram, long value) {
for (HistogramIterationValue iterationValue : histogram.allValues()) {
if (iterationValue.getTotalCountToThisValue() == 0) {
continue;
}
long max = iterationValue.getValueIteratedTo();
long min = iterationValue.getValueIteratedFrom();
if (value >= min && value <= max) {
return true;
}
}
return false;
}
示例3: getValues
import org.HdrHistogram.HistogramIterationValue; //导入方法依赖的package包/类
@Override
public long[] getValues() {
long[] values = new long[(int) histogram.getTotalCount()];
int i = 0;
for (HistogramIterationValue value : histogram.recordedValues()) {
long v = value.getValueIteratedTo();
for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) {
values[i] = v;
i++;
}
}
return values;
}
示例4: dump
import org.HdrHistogram.HistogramIterationValue; //导入方法依赖的package包/类
@Override
public void dump(OutputStream output) {
try (PrintWriter out = new PrintWriter(new OutputStreamWriter(output, StandardCharsets.UTF_8))) {
for (HistogramIterationValue value : histogram.recordedValues()) {
long v = value.getValueIteratedTo();
for (int j = 0; j < value.getCountAddedInThisIterationStep(); j++) {
out.printf("%d%n", v);
}
}
}
}
示例5: merge
import org.HdrHistogram.HistogramIterationValue; //导入方法依赖的package包/类
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;
}