[RUM-9617] - Base Benchmark app with support for Test Scenarios and external config#881
Conversation
094683c to
a348fb9
Compare
Datadog ReportBranch report: ✅ 0 Failed, 661 Passed, 1 Skipped, 3.76s Total Time |
a41dfe2 to
5b8bda0
Compare
| implementation "com.datadoghq:dd-sdk-android-rum:2.21.0" | ||
| implementation "com.datadoghq:dd-sdk-android-logs:2.21.0" | ||
| implementation "com.datadoghq:dd-sdk-android-trace:2.21.0" | ||
| implementation "com.datadoghq:dd-sdk-android-webview:2.21.0" |
There was a problem hiding this comment.
This PR needs Android SDK 2.21.0 as the Vitals tracking module was compiled with that version (it relies on Metrics improvements done on that version).
For this, we'll need to merge this PR first.
There was a problem hiding this comment.
We now include the benchmark tools directly from Maven, but I still want to keep them at 2.21.0 since there were important changes included on that version that our Vitals tracking native modules rely on.
| // From the release branch of dd-sdk-android, run: | ||
| // ./gradlew :tools:benchmark:assembleRelease | ||
| // Then copy the resulting .aar into benchmarks/android/app/libs | ||
| implementation(name: 'benchmark-release', ext: 'aar') |
There was a problem hiding this comment.
The benchmark app relies on the tools/benchmarks vitals tracking code on dd-sdk-android, however, that code is not published as a standalone dependency that can be imported into different projects, so at least for now, I opted for including it as a precompiled .aar into this package. This means that we need to recompile it whenever we bump the Android version.
On next iterations we can replace this with an external dependency if we decide to make the benchmarks project public.
There was a problem hiding this comment.
I believe this and the iOS code duplication are the only critical issues to address, as manually assembling the AAR for each bump of the Android SDK version would be too complex, and maintaining many duplicate iOS classes is not ideal.
There was a problem hiding this comment.
you can already include the tools:benchmark module like this implementation "com.datadoghq:benchmark:2.19.2". It is published.
There was a problem hiding this comment.
Thanks @aleksandr-gringauz, let me give it a try. I assume 2.21.0 is also available?
There was a problem hiding this comment.
It does indeed work. Thanks for raising this 🙇
@marco-saia-datadog I'll ask the iOS SDK team for support on this in case there's a similar solution possible on their end.
| import OpenTelemetryApi | ||
|
|
||
| internal final class Meter: DatadogInternal.BenchmarkMeter { | ||
| let meter: OpenTelemetryApi.Meter |
There was a problem hiding this comment.
These classes are a 1:1 match with the ones found on the iOS Benchmark app code.
Ideally, we should be able to only import this as an external dependency, but SPM does not allow for specific folder imports from Github, just whole projects.
|
If this PR does not yet implement any test scenarios, should this not be merged onto a feature brach, and only push to develop once the full behavior is implemented ? |
Thanks for the reviews 🙇 I'll create a feature branch as suggested, so things are cleaner 👍 |
5b8bda0 to
1c4993c
Compare
1c4993c to
1f907df
Compare
|
@janine-c Thanks a ton for your thorough review. I have updated the README.md with your suggestions and have clarified some parts 🙇 |
1f907df to
8403f09
Compare
8403f09 to
ad1921f
Compare
ad1921f to
a0f8388
Compare
janine-c
left a comment
There was a problem hiding this comment.
Looks great, thank you for applying those edits so quickly! 🚀
70bc798
into
sbarrio/RUM-9457/automated-regression-detecting-benchmark-system
What does this PR do?
This PR implements a base implementation for an app that can be internally used as a benchmark tester of different scenarios. It lays out the groundwork needed to be able to set up different kinds of builds, tests and related configurations so test scenarios can be run under different environments and instrumentation conditions. It allows for new scenarios to be added easily, allowing them to be instrumented with the Datadog SDK. It also enables a set of vitals tracking systems at the native level so metrics on CPU/Memory/FPS are tracked and reported too.
Motivation
We want to have a set of automatic benchmark tests run every time we merge code to develop.
Additional Notes
This PR on itself does not yet implement any real test scenario nor sets up a CI pipeline for tests. That will come on the next PRs right after this one. This is just laying the groundwork needed for those to work.
Review checklist (to be filled by reviewers)