How to output JMH benchmark result into a local json file?

51 Views Asked by At

I am using JMH for benchmark tests. I want to output test result into json file and visualize the result use JMH Visualizer. However I wasn't able to find the output file "V3Benchmark.json" with JSON format:

Options opt = new OptionsBuilder().include(myBenchmarkClass.class.getSimpleName()).result("V3Benchmark.json")
                .resultFormat(ResultFormatType.JSON).build();
        Collection<RunResult> run = new Runner(opt).run();

I ran my tests using java -jar target/benchmarks.jar. Did I miss something here?

Searched JMH GitHub website: https://github.com/openjdk/jmh, and didn't find documentation about how to output result file.

0

There are 0 best solutions below