|
33 | 33 |
|
34 | 34 | import java.io.IOException; |
35 | 35 | import java.io.InputStream; |
36 | | -import java.util.concurrent.atomic.AtomicBoolean; |
37 | 36 |
|
38 | 37 | import ai.timefold.solver.benchmarks.micro.common.AbstractMain; |
39 | 38 |
|
40 | | -import org.openjdk.jmh.results.Result; |
41 | 39 | import org.openjdk.jmh.runner.Runner; |
42 | 40 | import org.openjdk.jmh.runner.RunnerException; |
43 | 41 | import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; |
@@ -78,26 +76,21 @@ public static void main(String[] args) throws RunnerException, IOException { |
78 | 76 | var relativeScoreErrorThreshold = configuration.getRelativeScoreErrorThreshold(); |
79 | 77 | var thresholdForPrint = ((int) Math.round(relativeScoreErrorThreshold * 10_000)) / 100.0D; |
80 | 78 | runResults.forEach(result -> { |
81 | | - Result<?> primaryResult = result.getPrimaryResult(); |
| 79 | + var primaryResult = result.getPrimaryResult(); |
82 | 80 | var score = primaryResult.getScore(); |
83 | 81 | var scoreError = primaryResult.getScoreError(); |
84 | 82 | var relativeScoreError = scoreError / score; |
85 | 83 |
|
86 | 84 | var benchParams = result.getParams(); |
87 | 85 | var benchmarkName = benchParams.getBenchmark() + " " + benchParams.getParam("csExample"); |
88 | 86 | var relativeScoreErrorForPrint = ((int) Math.round(relativeScoreError * 10_000)) / 100.0D; |
89 | | - var wasSuccess = new AtomicBoolean(true); |
90 | 87 | if (relativeScoreError > relativeScoreErrorThreshold) { |
91 | | - LOGGER.error("Score error for '{}' is too high: ± {} % (threshold: ± {} %).", benchmarkName, |
| 88 | + LOGGER.warn("Score error for '{}' is too high: ± {} % (threshold: ± {} %).", benchmarkName, |
92 | 89 | relativeScoreErrorForPrint, thresholdForPrint); |
93 | | - wasSuccess.set(false); |
94 | 90 | } else if (relativeScoreError > (relativeScoreErrorThreshold * 0.9)) { |
95 | | - LOGGER.warn("Score error for '{}' approaching threshold: ± {} % (threshold: ± {} %).", benchmarkName, |
| 91 | + LOGGER.info("Score error for '{}' approaching threshold: ± {} % (threshold: ± {} %).", benchmarkName, |
96 | 92 | relativeScoreErrorForPrint, thresholdForPrint); |
97 | 93 | } |
98 | | - if (!wasSuccess.get()) { |
99 | | - System.exit(1); |
100 | | - } |
101 | 94 | }); |
102 | 95 | } |
103 | 96 |
|
|
0 commit comments