本文整理匯總了Java中org.HdrHistogram.Histogram.getTotalCount方法的典型用法代碼示例。如果您正苦於以下問題:Java Histogram.getTotalCount方法的具體用法?Java Histogram.getTotalCount怎麽用?Java Histogram.getTotalCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.HdrHistogram.Histogram
的用法示例。
在下文中一共展示了Histogram.getTotalCount方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSummary
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
/**
* 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 ditb.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)) + "]";
}
示例2: printStats
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
private static void printStats(Histogram data) {
long totalCount = data.getTotalCount();
System.out.println("Total count: " + totalCount);
if (totalCount > 0) {
System.out.println("MIN\tMAX\tMEAN\t30%\t50%\t90%\t95%\t99%\t99.99%\tSTDDEV");
System.out.format("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
TimeUnit.NANOSECONDS.toMicros(data.getMinValue()),
TimeUnit.NANOSECONDS.toMicros(data.getMaxValue()),
TimeUnit.NANOSECONDS.toMicros((long) data.getMean()),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(30.0)),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(50.0)),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(90.0)),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(95.0)),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(99.0)),
TimeUnit.NANOSECONDS.toMicros(data.getValueAtPercentile(99.99)),
TimeUnit.NANOSECONDS.toMicros((long) data.getStdDeviation()));
}
}
示例3: exmapleUsageTest
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
@Ignore
public void exmapleUsageTest() {
CPUMonitor monitor = new CPUMonitor(200); //5 per second
monitor.start();
try {
Thread.sleep(900);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return;
}
Histogram histogram = monitor.stop();
assertTrue(null!=histogram);
if (histogram.getTotalCount()>0) {//some platforms do not support this monitor.
assertEquals(5, histogram.getTotalCount());
}
PrintStream printStream = new PrintStream(new ByteArrayOutputStream());
histogram.outputPercentileDistribution(printStream, CPUMonitor.UNIT_SCALING_RATIO);
}
示例4: getSnapshot
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
public static Snapshot getSnapshot(Histogram histogram, Function<Histogram, Snapshot> snapshotTaker) {
if (histogram.getTotalCount() > 0) {
return snapshotTaker.apply(histogram);
} else {
return EmptySnapshot.INSTANCE;
}
}
示例5: reset
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
public static void reset(Histogram histogram) {
if (histogram.getTotalCount() > 0) {
histogram.reset();
}
}
示例6: addSecondToFirst
import org.HdrHistogram.Histogram; //導入方法依賴的package包/類
public static void addSecondToFirst(Histogram first, Histogram second) {
if (second.getTotalCount() > 0) {
first.add(second);
}
}