-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Benchmark workflows #5842
Add Benchmark workflows #5842
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Benchmark Tags | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sdk-benchmark: | ||
name: Benchmark SDK | ||
runs-on: self-hosted | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tag-version: | ||
- v1.6.0 | ||
- v1.7.0 | ||
- v1.7.1 | ||
- v1.10.0 | ||
- v1.10.1 | ||
- v1.11.0 | ||
- v1.12.0 | ||
- v1.13.0 | ||
- v1.14.0 | ||
- v1.15.0 | ||
- v1.16.0 | ||
- v1.17.0 | ||
- v1.18.0 | ||
- v1.19.0 | ||
- v1.21.0 | ||
- v1.22.0 | ||
- v1.23.0 | ||
- v1.23.1 | ||
- v1.24.0 | ||
- v1.25.0 | ||
- v1.26.0 | ||
- v1.27.0 | ||
- v1.28.0 | ||
- v1.29.0 | ||
- v1.30.0 | ||
- v1.30.1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.tag-version }} | ||
|
||
- id: setup-java | ||
name: Set up Java for build | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
jmhJar | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
|
||
- name: Run Benchmark | ||
run: | | ||
cd sdk/trace/build | ||
java -jar libs/opentelemetry-sdk-trace-*-jmh.jar -rf json SpanBenchmark SpanPipelineBenchmark ExporterBenchmark | ||
|
||
- name: Store benchmark results | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: 'jmh' | ||
output-file-path: sdk/trace/build/jmh-result.json | ||
gh-pages-branch: benchmarks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
benchmark-data-dir-path: "" | ||
auto-push: true | ||
ref: ${{ matrix.tag-version }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Benchmark Main | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having two workflow files (one for backfilling and one for updates to main), can we have a single workflow which takes an optional tag as an argument, defaulting to use the main branch if not set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can, but I worry that would give the impression that it would work on any tag when it can only work with 1.6+. Is this important to you? It seems that would be a lot more work involved in backfilling all the versions I enumerated here. We don't even need to keep this long term. It can be deleted after a successful run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not important and we can iterate. If it turns out that we want to backfill performance runs on a recurring basis, let's consider refactoring some sort reusuable work flow (i.e. reusable-markdown-link-check.yml). |
||
|
||
jobs: | ||
sdk-benchmark: | ||
name: Benchmark SDK | ||
runs-on: self-hosted | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: setup-java | ||
name: Set up Java for build | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
jmhJar | ||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | ||
|
||
- name: Run Benchmark | ||
run: | | ||
cd sdk/trace/build | ||
java -jar libs/opentelemetry-sdk-trace-*-jmh.jar -rf json SpanBenchmark SpanPipelineBenchmark ExporterBenchmark | ||
|
||
- name: Store benchmark results | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: 'jmh' | ||
output-file-path: sdk/trace/build/jmh-result.json | ||
gh-pages-branch: benchmarks | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
benchmark-data-dir-path: "" | ||
auto-push: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage of this over
./gradlew :sdk:trace:jmh -PjmhIncludeSingleClass=SpanBenchmark
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try that approach. This seems equivalent to me.