Skip to content

RUM-9958: Align datadog initialization with ios for benchmark app#2647

Merged
aleksandr-gringauz merged 2 commits into
developfrom
aleksandr-gringauz/RUM-9958/align-datadog-init-with-ios-for-benchmarks
May 14, 2025
Merged

RUM-9958: Align datadog initialization with ios for benchmark app#2647
aleksandr-gringauz merged 2 commits into
developfrom
aleksandr-gringauz/RUM-9958/align-datadog-init-with-ios-for-benchmarks

Conversation

@aleksandr-gringauz

@aleksandr-gringauz aleksandr-gringauz commented May 14, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

As we discussed in one of our meetings, we should align Datadog SDK initialization for baseline runs of our benchmark scenarios between iOS and Android. The consensus was to do it the same way as on iOS - for baseline runs no Datadog components should be initialized. For example for session replay link.

What changed:

  1. Datadog SDK Core isn't initialized in baseline run.
  2. Rum isn't initialized in baseline run for session replay.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/RUM-9958/align-datadog-init-with-ios-for-benchmarks branch from 4df6a7a to c500f7d Compare May 14, 2025 11:42
@aleksandr-gringauz
aleksandr-gringauz marked this pull request as ready for review May 14, 2025 11:53
@aleksandr-gringauz
aleksandr-gringauz requested review from a team as code owners May 14, 2025 11:53
0xnm
0xnm previously approved these changes May 14, 2025
Comment on lines +98 to +100
return when (isInstrumentedRun(config)) {
true -> isSessionReplayScenario(config) || isRumScenario(config)
false -> isSessionReplayScenario(config)
false -> false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just curious: is there any benefit of when(boolean) vs if-else? is it the same bytecode after all?

@aleksandr-gringauz aleksandr-gringauz May 14, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

https://gist.github.com/aleksandr-gringauz/8850479ea36934f937be162d79ef7fc0

this is what I got when decompiling kotlin code for desktop jvm in intellij

looks like when adds some overhead related to throwing NoWhenBranchMatchedException. Why is it doing this - I currently don't know, it is an exhaustive when, compiler should be able to figure it out.

Changed to if in my case, probably if is more idiomatic anyway.

Comment on lines +109 to +110
{ Log.w("BackPressure", "THRESHOLD REACHED!") },
{ Log.e("BackPressure", "ITEM DROPPED $it!") },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's avoid screaming in the logs :)

Suggested change
{ Log.w("BackPressure", "THRESHOLD REACHED!") },
{ Log.e("BackPressure", "ITEM DROPPED $it!") },
{ Log.w("BackPressure", "Threshold reached") },
{ Log.e("BackPressure", "Item dropped: $it") },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

ambushwork
ambushwork previously approved these changes May 14, 2025
@aleksandr-gringauz
aleksandr-gringauz dismissed stale reviews from ambushwork and 0xnm via f572439 May 14, 2025 12:29
@aleksandr-gringauz
aleksandr-gringauz merged commit 9515e48 into develop May 14, 2025
@aleksandr-gringauz
aleksandr-gringauz deleted the aleksandr-gringauz/RUM-9958/align-datadog-init-with-ios-for-benchmarks branch May 14, 2025 13:17
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.

3 participants