Running JMH Runner from inside the source code?

Behrooz N nobeh5 at gmail.com
Mon Feb 3 02:11:29 PST 2014


Hi,

I have been trying the following from the source code of some project:

@State(Scope.Benchmark)public class AppMicroBenchmark {

    private App app = new App();

    @GenerateMicroBenchmark
    public void run() {
        try {
            app.run();
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws RunnerException {
        Options options = new
OptionsBuilder().include(".*").exclude(".*openjdk.*")
                .warmupIterations(1000).measurementIterations(100000)
                .verbosity(VerboseMode.EXTRA).build();
        new Runner(options).run();
    }

}

All proper dependencies are set from Maven with JMH Core and Samples.
However, in the output of the Runner, I can observe that all benchmarks are
excluded however the AppMicroBenchmark is not picked up. What am I missing
or using in a wrong way?

Thanks in advance,
Behrooz


More information about the jmh-dev mailing list