Skip to content

RUM-8632: Introducing UISlownessMetricDispatcher#2567

Merged
satween merged 3 commits into
developfrom
tvaleev/feature/RUM-8632-ui_slowness-telemetry
Mar 28, 2025
Merged

RUM-8632: Introducing UISlownessMetricDispatcher#2567
satween merged 3 commits into
developfrom
tvaleev/feature/RUM-8632-ui_slowness-telemetry

Conversation

@satween

@satween satween commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

"RUM UI Slowness" Telemetry support for UI slowness feature

See spec for more details

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)

@satween
satween requested review from a team as code owners March 24, 2025 17:59
@satween
satween force-pushed the tvaleev/feature/RUM-8632-ui_slowness-telemetry branch from f16c1a7 to d58cead Compare March 24, 2025 17:59
@codecov-commenter

codecov-commenter commented Mar 24, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 94.64286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.17%. Comparing base (245c50a) to head (2c29fcd).
Report is 203 commits behind head on develop.

Files with missing lines Patch % Lines
...al/metric/slowframes/UISlownessMetricDispatcher.kt 94.87% 0 Missing and 2 partials ⚠️
...m/internal/metric/slowframes/SlowFramesListener.kt 90.91% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2567      +/-   ##
===========================================
+ Coverage    70.14%   70.17%   +0.03%     
===========================================
  Files          803      804       +1     
  Lines        30146    30196      +50     
  Branches      5046     5050       +4     
===========================================
+ Hits         21145    21190      +45     
+ Misses        7600     7595       -5     
- Partials      1401     1411      +10     
Files with missing lines Coverage Δ
...droid/rum/configuration/SlowFramesConfiguration.kt 100.00% <100.00%> (ø)
...lin/com/datadog/android/rum/internal/RumFeature.kt 91.52% <100.00%> (-0.49%) ⬇️
...m/internal/metric/slowframes/SlowFramesListener.kt 97.83% <90.91%> (+0.39%) ⬆️
...al/metric/slowframes/UISlownessMetricDispatcher.kt 94.87% <94.87%> (ø)

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jonathanmos
jonathanmos previously approved these changes Mar 25, 2025
internal const val KEY_MAX_DURATION = "max_duration"
internal const val KEY_VIEW_MIN_DURATION = "view_min_duration"

internal const val KEY_FREEZED_FRAMES = "freezed_frames"

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.

Are we sure about the use of "freezed frames" for the plural? I think frozen frames would be more correct

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.

Yep, I agree. The problem that we already have "frozen" word in many places. I was trying to separate this one from the others. But probably we should stick to the correct word anyway

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.

We decided to remove frozen frames from the telemetry for now. We gonna add them separately

@satween
satween force-pushed the tvaleev/feature/RUM-8632-ui_slowness-telemetry branch from d58cead to 9151319 Compare March 27, 2025 11:35
ambushwork
ambushwork previously approved these changes Mar 27, 2025
0xnm
0xnm previously approved these changes Mar 28, 2025
Comment on lines +116 to +121
verify(mockInternalLogger).logMetric(
argThat { invoke() == DefaultUISlownessMetricDispatcher.UI_SLOWNESS_MESSAGE },
argThat { hasExpectedValue(1, KEY_RUM_UI_SLOWNESS, KEY_SLOW_FRAMES, KEY_IGNORED_COUNT) },
eq(fakeSamplingRate),
eq(null)
)

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.

minor: in case of the failure the error will be generic - something like the method was expected to be called with arguments matching the certain criteria, but it wasn't, and it will take some effort to understand what exactly didn't match (and in this test we are targeting the specific attribute).

We could just use arguments captor to capture attributes and assert them granularly, providing the exact message about the failure reason.

But anyway, this is just minor, I'm okay with such assertion as well.

jonathanmos
jonathanmos previously approved these changes Mar 28, 2025
@satween
satween dismissed stale reviews from jonathanmos, 0xnm, and ambushwork via 2c29fcd March 28, 2025 13:12
@satween
satween merged commit f3f9c52 into develop Mar 28, 2025
@satween
satween deleted the tvaleev/feature/RUM-8632-ui_slowness-telemetry branch March 28, 2025 15:03
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