@@ -292,24 +292,22 @@ private Collection<RunResult> internalRun() throws RunnerException {
292292 boolean isInstrumented = InstrumentHooks .getInstance ().isInstrumented ();
293293 List <BenchmarkListEntry > newBenchmarks = new ArrayList <>();
294294 for (BenchmarkListEntry br : benchmarks ) {
295- if (br . getMode () == Mode . All ) {
296- if ( isInstrumented ) {
297- // CodSpeed: normalize Mode.All to AverageTime
295+ if (isInstrumented ) {
296+ // CodSpeed: normalize any mode to AverageTime
297+ if ( br . getMode () != Mode .AverageTime ) {
298298 out .println ("# CodSpeed: normalizing benchmark mode to AverageTime " +
299- "(was: Mode.All) for " + br .getUsername () + "." );
300- newBenchmarks .add (br .cloneWith (Mode .AverageTime ));
301- } else {
302- // Standard JMH: expand Mode.All into all concrete modes
303- for (Mode m : Mode .values ()) {
304- if (m == Mode .All ) continue ;
305- newBenchmarks .add (br .cloneWith (m ));
306- }
299+ "(was: " + br .getMode () + ") for " + br .getUsername () + "." );
307300 }
308- } else if (isInstrumented && br .getMode () != Mode .AverageTime ) {
309- // CodSpeed: normalize any non-AverageTime annotation mode to AverageTime
310- out .println ("# CodSpeed: normalizing benchmark mode to AverageTime " +
311- "(was: " + br .getMode () + ") for " + br .getUsername () + "." );
312301 newBenchmarks .add (br .cloneWith (Mode .AverageTime ));
302+ continue ;
303+ }
304+
305+ // Standard JMH: expand Mode.All into all concrete modes
306+ if (br .getMode () == Mode .All ) {
307+ for (Mode m : Mode .values ()) {
308+ if (m == Mode .All ) continue ;
309+ newBenchmarks .add (br .cloneWith (m ));
310+ }
313311 } else {
314312 newBenchmarks .add (br );
315313 }
0 commit comments