Package com.lmax.disruptor.collections

Examples of com.lmax.disruptor.collections.Histogram


        // ThreadContext.put("aKey", "mdcVal");
        PerfTest.println("Warming up the JVM...");
        final long t1 = System.nanoTime();

        // warmup at least 2 rounds and at most 1 minute
        final Histogram warmupHist = PerfTest.createHistogram();
        final long stop = System.currentTimeMillis() + (60 * 1000);
        final Runnable run1 = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
View Full Code Here


        }
        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;
View Full Code Here

    // ThreadContext.put("aKey", "mdcVal");
    PerfTest.println("Warming up the JVM...");
    long t1 = System.nanoTime();

    // warmup at least 2 rounds and at most 1 minute
    final Histogram warmupHist = PerfTest.createHistogram();
    final long stop = System.currentTimeMillis() + (60 * 1000);
    Runnable run1 = new Runnable() {
      @Override
            public void run() {
        for (int i = 0; i < 10; i++) {
View Full Code Here

    }
    final int LINES = 256 * 1024;

    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;
            int latencyCount = 5000000;
View Full Code Here

    }

    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());
        }
    }
View Full Code Here

    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());
    }
View Full Code Here

            }
            return countDownReachedTime;
        }

        public Histogram getLatencyHistogram() {
            final Histogram histogram = new Histogram(LATENCY_HISTOGRAM_BOUNDS);
            for (final Long latencyValue : latencyQueue) {
                histogram.addObservation(latencyValue / 1000000);
            }
            return histogram;
        }
View Full Code Here

      intervalUpperBound *= 2;
      intervals[i] = intervalUpperBound;
    }

    intervals[intervals.length - 1] = Long.MAX_VALUE;
    return new Histogram(intervals);
  }
View Full Code Here

  }

  public void runTestAndPrintResult(final IPerfTestRunner runner,
      final String name, final int threadCount, final String resultFile)
      throws Exception {
    final Histogram warmupHist = createHistogram();

    // ThreadContext.put("aKey", "mdcVal");
    println("Warming up the JVM...");
    final long t1 = System.nanoTime();
View Full Code Here

    runSingleThreadedTest(runner, name, resultFile);
  }

  private int runSingleThreadedTest(final IPerfTestRunner runner, final String name,
      final String resultFile) throws IOException {
    final Histogram latency = createHistogram();
    final int LINES = throughput ? 50000 : 5000000;
    runTest(runner, LINES, "end", latency, 1);
    reportResult(resultFile, name, latency);
    return LINES;
  }
View Full Code Here

TOP

Related Classes of com.lmax.disruptor.collections.Histogram

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.