Package com.lmax.disruptor.collections

Examples of com.lmax.disruptor.collections.Histogram


    // 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() {
      public void run() {
        for (int i = 0; i < 10; i++) {
          final int LINES = PerfTest.throughput ? 50000 : 200000;
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() {
        public void run() {
//            int latencyCount = threadCount >= 16 ? 1000000 : 5000000;
            int latencyCount = 5000000;
          int count = PerfTest.throughput ? LINES / threadCount
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(IPerfTestRunner runner,
      final String name, int threadCount, String resultFile)
      throws Exception {
    Histogram warmupHist = createHistogram();

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

    runSingleThreadedTest(runner, name, resultFile);
  }

  private int runSingleThreadedTest(IPerfTestRunner runner, String name,
      String resultFile) throws IOException {
    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

      System.out.println(msg);
    }
  }

  static String createSamplingReport(String name, Histogram histogram) {
    Histogram data = histogram;
    if (throughput) {
      return data.getMax() + " operations/second";
    }
    String result = String.format(
        "avg=%.0f 99%%=%d 99.99%%=%d sampleCount=%d", data.getMean(), //
        data.getTwoNinesUpperBound(), //
        data.getFourNinesUpperBound(), //
        data.getCount() //
        );
    return result;
  }
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

            System.out.println(msg);
        }
    }

    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;
    }
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.