use of com.lmax.disruptor.collections.Histogram in project camel by apache.
the class SedaDisruptorCompareTest method uninstallSizeMonitoring.
private void uninstallSizeMonitoring(final ExecutorService monitoring) {
if (monitoring != null) {
monitoring.shutdownNow();
}
final Histogram histogram = new Histogram(sizeHistogramBounds);
for (final int observation : endpointSizeQueue) {
histogram.addObservation(observation);
}
System.out.printf("%82s %s%n", "Endpoint size (# exchanges pending):", histogram.toString());
}
use of com.lmax.disruptor.collections.Histogram in project camel by apache.
the class SedaDisruptorCompareTest method outputExchangeAwaitersResult.
private void outputExchangeAwaitersResult(final long start) throws InterruptedException {
for (final ExchangeAwaiter exchangeAwaiter : exchangeAwaiters) {
final long stop = exchangeAwaiter.getCountDownReachedTime();
final Histogram histogram = exchangeAwaiter.getLatencyHistogram();
System.out.printf("%-45s time spent = %5d ms. Latency (ms): %s %n", componentName, stop - start, histogram.toString());
}
}
use of com.lmax.disruptor.collections.Histogram in project logging-log4j2 by apache.
the class PerfTest method createSamplingReport.
static String createSamplingReport(final String name, final Histogram histogram) {
final Histogram data = histogram;
if (throughput) {
return data.getMax() + " operations/second";
}
final String result = //
String.format(//
"avg=%.0f 99%%=%d 99.99%%=%d sampleCount=%d", //
data.getMean(), //
data.getTwoNinesUpperBound(), //
data.getFourNinesUpperBound(), //
data.getCount());
return result;
}
use of com.lmax.disruptor.collections.Histogram in project logging-log4j2 by apache.
the class PerfTest method runSingleThreadedTest.
private int runSingleThreadedTest(final IPerfTestRunner runner, final int LINES, final String name, final String resultFile) throws IOException {
final Histogram latency = createHistogram();
runTest(runner, LINES, "end", latency, 1);
reportResult(resultFile, name, latency);
return LINES;
}
use of com.lmax.disruptor.collections.Histogram in project logging-log4j2 by apache.
the class MultiThreadPerfTest method multiThreadedTestRun.
private void multiThreadedTestRun(final IPerfTestRunner runner, final String name, final int threadCount, final String resultFile) throws Exception {
final Histogram[] histograms = new Histogram[threadCount];
for (int i = 0; i < histograms.length; i++) {
histograms[i] = PerfTest.createHistogram();
}
final int LINES = 256 * 1024;
final Thread[] threads = new Thread[threadCount];
for (int i = 0; i < threads.length; i++) {
final Histogram histogram = histograms[i];
threads[i] = new Thread() {
@Override
public void run() {
// int latencyCount = threadCount >= 16 ? 1000000 : 5000000;
final int latencyCount = 5000000;
final int count = PerfTest.throughput ? LINES / threadCount : latencyCount;
runTest(runner, count, "end", histogram, threadCount);
}
};
}
for (final Thread thread : threads) {
thread.start();
}
for (final Thread thread : threads) {
thread.join();
}
for (final Histogram histogram : histograms) {
PerfTest.reportResult(resultFile, name, histogram);
}
}
Aggregations