Skip to content
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

RUM-5551 Add Benchmark Tests Project #1977

Merged
merged 13 commits into from
Aug 14, 2024
Merged

Conversation

maxep
Copy link
Member

@maxep maxep commented Jul 26, 2024

What and why?

Introduce the Benchmark project for continuously measure the SDK performances in a host application. This PR includes the following:

  • Benchmark Runner application (similar to E2E Tests)
  • Benchmark Package depending on opentelemetry-swift
  • CI configuration for upload a new api to Synthetics

How?

Benchmark Tests Project

The BenchmarkTests/BenchmarkTests.xcodeproj includes a Runner application with simple logic the select a scenario from env variable. The project defines the same abstraction as E2ETests to define scenarios.

The BenchmarkTests/Benchmarks/Package.swift depends on opentelemetry-swift and will later define metrics collector and exporter to Datadog.

CI

CI configuration is almost identical as E2ETests to build, sign, and upload the api to s8s.
The added tools/utils/code-sign.sh allow sharing the steps to install the provisioning profile and certificate on the build machine.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

@maxep maxep force-pushed the feature/continuous-benchmarks branch 9 times, most recently from eac66a0 to a6ad807 Compare August 1, 2024 13:20
@maxep maxep marked this pull request as ready for review August 1, 2024 13:21
@maxep maxep requested review from a team as code owners August 1, 2024 13:21
@cswatt cswatt added the editorial review Waiting on a more in-depth review from the docs team label Aug 1, 2024
@cswatt
Copy link
Contributor

cswatt commented Aug 1, 2024

added DOCS-8608 to review

Copy link
Member

@mariedm mariedm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 🙌

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let info = try! TestInfo() // crash if test info are missing or malformed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to log an error here for debugging purposes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception error will give us enough info to troubleshoot 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine real implementations for export, flush and shutdown will come later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, implementation will come later 👍

@maxep maxep added editorial review Waiting on a more in-depth review from the docs team and removed editorial review Waiting on a more in-depth review from the docs team labels Aug 2, 2024
@maxep maxep force-pushed the feature/continuous-benchmarks branch from a6ad807 to bc24e9d Compare August 5, 2024 13:42
.gitlab-ci.yml Outdated Show resolved Hide resolved
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start for continuous benchmarking project 🚀! I really like the work done on shell scripts, CI secrets and makefiles - notably reusing and sharing existing bits. This PR greatly follows conventions started with GitLab migration 🏅.

I left few comments, notably touching on two areas:

  • Benchmark project configuration: we should aim at providing most of it through xcconfig files rather than utilizing pbxproj overrides (this is hard to maintain).
  • Level of details in README.md - this file doesn't look future-proof in its current state. Details will change, but README.md will be likely forgotten. Also, it doesn't cover enough details for setting up s8s tests and I don't even think they should belong to this file. We must document all aspects critical to team's operations, likely in iOS > Automations > Benchmark Tests Confluence page (can be done later, ofc). 👈 This is a lesson learnt from Shopist iOS and E2E Tests automations, which both include README.md but working on s8s tests requires reverse-engineering of existing setup. For that reason we should clearly separate what we want from README (high-level overview for public audience) vs Confluence (internal details for the team).

BenchmarkTests/Benchmarks/Package.swift Show resolved Hide resolved
BenchmarkTests/Makefile Outdated Show resolved Hide resolved
BenchmarkTests/README.md Outdated Show resolved Hide resolved
BenchmarkTests/README.md Outdated Show resolved Hide resolved
BenchmarkTests/README.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
tools/secrets/config.sh Outdated Show resolved Hide resolved
tools/secrets/config.sh Outdated Show resolved Hide resolved
tools/utils/code-sign.sh Outdated Show resolved Hide resolved
BenchmarkTests/BenchmarkTests.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review

BenchmarkTests/README.md Outdated Show resolved Hide resolved
BenchmarkTests/README.md Outdated Show resolved Hide resolved
@maxep maxep force-pushed the feature/continuous-benchmarks branch from bc24e9d to d76d2a2 Compare August 8, 2024 09:30
ncreated
ncreated previously approved these changes Aug 8, 2024
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 🪨 💯 Please also consider the suggestion to .gitlab-ci.yml - seems omitted.

.gitlab-ci.yml Outdated Show resolved Hide resolved
tools/secrets/config.sh Outdated Show resolved Hide resolved
pgrep -q Xcode && killall Xcode && echo_warn "- Xcode killed" || echo_succ "- Xcode not running"
sleep 0.5 && echo "- launching" # Sleep, otherwise, if Xcode was running it often fails with "procNotFound: no eligible process with specified descriptor"
open --env DD_TEST_UTILITIES_ENABLED "$TEST_WORKSPACE"
open --new --env DD_TEST_UTILITIES_ENABLED "$TEST_WORKSPACE"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏅 nice!

Co-authored-by: Maciek Grzybowski <[email protected]>
@maxep maxep requested review from ncreated and rtrieu and removed request for rtrieu August 13, 2024 14:14
@maxep maxep removed the editorial review Waiting on a more in-depth review from the docs team label Aug 14, 2024

### Synthetics Configuration

Please refer to [Confluence page (internal)](https://datadoghq.atlassian.net/wiki/spaces/RUMP/pages/3981476482/Benchmarks+iOS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last minor suggestion, but otherwise looks good!


## CI

CI continuously builds, signs, and uploads a runner application to Synthetics which runs predefined tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CI continuously builds, signs, and uploads a runner application to Synthetics which runs predefined tests.
CI continuously builds, signs, and uploads a runner application to Synthetics, which runs predefined tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, adding in a follow-up PR 👍

@maxep maxep merged commit 6a54100 into develop Aug 14, 2024
17 checks passed
@maxep maxep deleted the feature/continuous-benchmarks branch August 14, 2024 14:21
@maxep maxep mentioned this pull request Aug 20, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants