Running JMH Runner from inside the source code?

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Feb 3 02:21:02 PST 2014


Hi Behrooz,

On 02/03/2014 02:11 PM, Behrooz N wrote:
> 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?

Can you please post the complete run log somewhere (Gist?), which
includes the pattern match/mismatch lines?

-Aleksey.



More information about the jmh-dev mailing list