Class BenchmarkHandler


  • class BenchmarkHandler
    extends java.lang.Object
    Base class for all benchmarks handlers.
    • Field Detail

      • executor

        private final java.util.concurrent.ExecutorService executor
        Thread-pool for threads executing the benchmark tasks
      • tps

        private final java.util.concurrent.BlockingQueue<ThreadParams> tps
      • clazz

        private final java.lang.Class<?> clazz
      • method

        private final java.lang.reflect.Method method
    • Method Detail

      • distributeThreads

        static java.util.List<ThreadParams> distributeThreads​(int threads,
                                                              int[] groups)
      • findBenchmarkMethod

        public static java.lang.reflect.Method findBenchmarkMethod​(java.lang.Class<?> clazz,
                                                                   java.lang.String methodName)
      • isValidBenchmarkSignature

        private static boolean isValidBenchmarkSignature​(java.lang.reflect.Method m)
        checks if method signature is valid benchmark signature, besited checks if method signature corresponds to benchmark type.
        Parameters:
        m -
        Returns:
      • shutdown

        public void shutdown()
        Do required shutdown actions.
      • runIteration

        public IterationResult runIteration​(BenchmarkParams benchmarkParams,
                                            IterationParams params,
                                            boolean last)
        Runs an iteration on the handled benchmark.
        Parameters:
        benchmarkParams - Benchmark parameters
        params - Iteration parameters
        last - Should this iteration considered to be the last
        Returns:
        IterationResult