Skip to content

Commit c404e2f

Browse files
committed
Configurable
1 parent ffbc50a commit c404e2f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/benchmark.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,21 @@ jobs:
4343
- name: Run jmh
4444
run: ./gradlew jmhJar
4545

46+
- name: Check which benchmarks to run
47+
id: benchmarks
48+
run: |
49+
DEFAULT="SpanBenchmark SpanPipelineBenchmark ExporterBenchmark"
50+
if [ "${{ github.event_name }}" = "pull_request" ]; then
51+
BENCHMARKS=$(echo "${{ github.event.pull_request.body }}" | grep "Benchmarks:" | sed 's/^\s*Benchmarks:\s*//' | head -1 | xargs)
52+
echo "list=${BENCHMARKS:-$DEFAULT}" >> $GITHUB_OUTPUT
53+
else
54+
echo "list=$DEFAULT" >> $GITHUB_OUTPUT
55+
fi
56+
4657
- name: Run Benchmark
4758
run: |
4859
cd sdk/trace/build
49-
java -jar libs/opentelemetry-sdk-trace-*-jmh.jar -rf json SpanBenchmark SpanPipelineBenchmark ExporterBenchmark
60+
java -jar libs/opentelemetry-sdk-trace-*-jmh.jar -rf json ${{ steps.benchmarks.outputs.list }}
5061
5162
- name: Use CLA approved github bot
5263
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)