From 90e19a82ca5a0f22c8f8f2920387dd7098abe667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Wed, 15 Jan 2025 19:41:55 +0100 Subject: [PATCH] ci: improve the JFR copying logic --- .github/workflows/performance_score_director.yml | 4 ++-- .../benchmarks/micro/common/ResultCapturingJMHRunner.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/performance_score_director.yml b/.github/workflows/performance_score_director.yml index 26aac69..0206e38 100644 --- a/.github/workflows/performance_score_director.yml +++ b/.github/workflows/performance_score_director.yml @@ -217,11 +217,11 @@ jobs: path: | ./timefold-solver-benchmarks/scoredirector-benchmark.properties ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.baseline }}/*.log - ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.baseline }}/*.jfr + ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.baseline }}/combined.jfr ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.baseline }}/*.html ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.baseline }}/*.json ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.branch }}/*.log - ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.branch }}/*.jfr + ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.branch }}/combined.jfr ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.branch }}/*.html ./timefold-solver-benchmarks/results/scoredirector/${{ github.event.inputs.branch }}/*.json diff --git a/src/main/java/ai/timefold/solver/benchmarks/micro/common/ResultCapturingJMHRunner.java b/src/main/java/ai/timefold/solver/benchmarks/micro/common/ResultCapturingJMHRunner.java index d4d5ff6..3c26a84 100644 --- a/src/main/java/ai/timefold/solver/benchmarks/micro/common/ResultCapturingJMHRunner.java +++ b/src/main/java/ai/timefold/solver/benchmarks/micro/common/ResultCapturingJMHRunner.java @@ -104,7 +104,9 @@ private static File findJfrFile(File file) { return result; } } - } else if (file.getName().endsWith(".jfr")) { + } else if (file.getName().startsWith("jfr-") && file.getName().endsWith(".jfr")) { + // Only match the jfr-cpu.jfr file produced by JMH. + // Otherwise the previously copied files could also be matched. return file; } return null;