-
Notifications
You must be signed in to change notification settings - Fork 936
Rework and publish metric benchmarks #8000
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
Conversation
| with: | ||
| tool: 'jmh' | ||
| output-file-path: sdk/trace/build/jmh-result.json | ||
| output-file-path: sdk/all/build/jmh-result.json |
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.
@tylerbenson this benchmark-action only allows you to have a single output file path. This means we need to all the published benchmarks to be in a single module, such that we can run with them a single java -jar *-jmh.jar ... command. I think the opentelemetry-sdk artifact is a good spot for this.
This turns out to be a useful constraint as I think it will be nice to have all the public benchmarks colocated.
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.
LTGM!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8000 +/- ##
============================================
+ Coverage 90.13% 90.14% +0.01%
- Complexity 7469 7476 +7
============================================
Files 833 834 +1
Lines 22523 22540 +17
Branches 2234 2236 +2
============================================
+ Hits 20301 20319 +18
+ Misses 1517 1516 -1
Partials 705 705 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tylerbenson
left a comment
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.
While you're at it, you might consider squashing the commit history for the results branch as it continues to grow each run. Especially since this change will invalidate prior results.
| with: | ||
| tool: 'jmh' | ||
| output-file-path: sdk/trace/build/jmh-result.json | ||
| output-file-path: sdk/all/build/jmh-result.json |
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.
LTGM!
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.
Pull request overview
This PR refactors the metrics benchmarking infrastructure to focus on high-level, user-relevant performance characteristics. The old micro-benchmarks in MetricsBenchmarks are replaced with a new comprehensive MetricRecordBenchmark that measures metric recording performance across multiple dimensions including instrument type/aggregation, temporality, cardinality, and thread count. The GitHub Actions workflow is updated to run and publish the new benchmarks to https://open-telemetry.github.io/opentelemetry-java/benchmarks/.
Changes:
- Removed old benchmark classes (
TestSdk,MetricsTestOperationBuilder,MetricsBenchmarks) that were too granular and less meaningful for end users - Added new
MetricRecordBenchmarkthat comprehensively tests metric recording performance across 40 meaningful test cases - Updated GitHub Actions workflow to run the new benchmark from sdk/all module instead of trace benchmarks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/TestSdk.java | Deleted old SDK configuration enum used by previous benchmarks |
| sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/MetricsTestOperationBuilder.java | Deleted old operation builder enum for micro-benchmarks |
| sdk/metrics/src/jmh/java/io/opentelemetry/sdk/metrics/MetricsBenchmarks.java | Deleted old micro-benchmark suite |
| sdk/all/src/jmh/java/io/opentelemetry/sdk/MetricRecordBenchmark.java | Added comprehensive benchmark measuring metric recording across instrument types, temporalities, cardinalities, and thread counts |
| sdk/all/build.gradle.kts | Added JMH dependency on testing module |
| .github/workflows/benchmark.yml | Updated to run new MetricRecordBenchmark from sdk/all instead of trace benchmarks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
As mentioned #7986, I've been working through some ideas to improve the performance of the metric SDK under high contention.
To illustrate the impact on these changes, I've reworked
MetricsBenchmarkto include dimensions that impact record performance. The set of dimensions that play some role include:That forms 2 * 2 * 2 * 2 * 2 * 2 * 5 = 320 unique test cases, which is just impractical. And so I narrow it down to the most meaningful dimensions:
With these eliminated, were down to 222*5 = 40 test cases, which is more reasonable.
I'm also using this as an opportunity to finish what @tylerbenson started and get into the routine of running benchmarks on each change on dedicated hardwhere, and publishing the results on https://open-telemetry.github.io/opentelemetry-java/benchmarks/
The unfinished problem was that the benchmarks in this repo are micro benchmarks. Their not very meaningful for end users and may even do more harm then good. What we need is a curated set of somewhat high level benchmarks, intentionally built to demonstrate / report on the types of performance characteristics that matter to end users.
This revamped
MetricRecordBenchmarkis the first of these. I will followup with dedicated benchmarks for other areas:For reference, here are the results of the revamped
MetricRecordBenchmarkon my machine: