Skip to content

RUM-4715:SwitchCompat mapper improvement#2117

Merged
ambushwork merged 1 commit into
feature/session-replay/compound-button-mappersfrom
yl/improve-switch-compat-mapper
Jul 3, 2024
Merged

RUM-4715:SwitchCompat mapper improvement#2117
ambushwork merged 1 commit into
feature/session-replay/compound-button-mappersfrom
yl/improve-switch-compat-mapper

Conversation

@ambushwork

@ambushwork ambushwork commented Jul 2, 2024

Copy link
Copy Markdown
Member

What does this PR do?

Improve the SwitchCompatMapper to make SwitchCompat have similar replay with the real UI.

Main Changes

  • Same as previous PR, the SwitchCompatMapper doesn't create ShapeWireframe any more for checked or unchecked state, instead, we extract the track drawable and thumb drawable to show the real graphic of the component.
  • Sample application is updated to demonstrate more state of switch buttons

Motivation

  • RUM-4715

What inspired you to submit this pull request?

Session replay demo

https://mobile-integration.datadoghq.com/rum/replay/sessions/128703cf-1202-45c6-a34a-8a8a2df7275d?applicationId=38030dde-f9f9-4e52-9443-b9804a030080&seed=bd9e3c7b-fbbf-4a75-89b7-a323624f0cd2&ts=1719931750249

New implementation overhead

Since the new implementation of SwitchCompatMapper create ImageWireframe other than ShapeWireframe, some overhead is in the expectation, to measure this, Method called metric is used to measure the total duration of creating a wire frame of each map method, here is the result

old implementation (Shape wireframe) new implementation (Image wireframe)
image image

As we can see the new implementation takes 180us on average, and old implementation takes 120~140us on average, the overhead is nearly 50% percent.

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)

@ambushwork
ambushwork requested review from a team as code owners July 2, 2024 14:53
@codecov-commenter

codecov-commenter commented Jul 2, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 89.74359% with 8 lines in your changes missing coverage. Please review.

Project coverage is 69.48%. Comparing base (8491d83) to head (a06a585).

Additional details and impacted files
@@                                Coverage Diff                                 @@
##           feature/session-replay/compound-button-mappers    #2117      +/-   ##
==================================================================================
+ Coverage                                           69.33%   69.48%   +0.15%     
==================================================================================
  Files                                                 715      715              
  Lines                                               26620    26602      -18     
  Branches                                             4464     4471       +7     
==================================================================================
+ Hits                                                18455    18482      +27     
+ Misses                                               6942     6879      -63     
- Partials                                             1223     1241      +18     
Files Coverage Δ
...nternal/recorder/mapper/CheckableTextViewMapper.kt 59.26% <ø> (ø)
...ternal/recorder/mapper/CheckableWireframeMapper.kt 100.00% <ø> (ø)
...lay/internal/recorder/mapper/SwitchCompatMapper.kt 92.31% <89.74%> (+33.39%) ⬆️

... and 29 files with indirect coverage changes

@ambushwork
ambushwork merged commit 4c699fa into feature/session-replay/compound-button-mappers Jul 3, 2024
@ambushwork
ambushwork deleted the yl/improve-switch-compat-mapper branch July 3, 2024 13:30
@xgouchet xgouchet added this to the 2.12.x milestone Jul 31, 2024
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