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

RUMM-1758 Add RUM Session debug utility #669

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

ncreated
Copy link
Member

What and why?

📦 As part of RUMM-1758 work (proposing RFC to reduce number of view updates), I made a simple tool to debug RUM session. I think we can leverage it on a longer run, so I'm adding it to our existing debug toolset.

How?

Unlike existing "Debug RUM" tool, this new "Debug RUM session" utility allows for sending RUM session composed from different events (actions, errors, resources). Additionally, resources can be controlled by their "start" and "stop", so it is possible to debug sequences like:

  • start view A
  • start resource R1
  • start resource R2
  • stop resource R1
  • start view B
  • stop resource R2

It's also all made in SwiftUI, so adding new features / utils could be easier.

Screenshot 2021-11-19 at 14 29 24

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

@ncreated ncreated self-assigned this Nov 19, 2021
@ncreated ncreated requested a review from a team as a code owner November 19, 2021 13:30
Comment on lines +34 to +36
internal struct DatadogButtonStyle: ButtonStyle {
func makeBody(configuration: DatadogButtonStyle.Configuration) -> some View {
return configuration.label
Copy link
Member Author

Choose a reason for hiding this comment

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

@maxep I'm wondering if this kind of styling is sth we could leverage in SwiftUI instrumentation? The way it works is by inserting:

.buttonStyle(DatadogButtonStyle())

in view declaration globally, which then runs this piece of code for all SwiftUI buttons. There are also distinct styles for lists and other elements.

Copy link
Member

@maxep maxep Nov 22, 2021

Choose a reason for hiding this comment

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

Interesting! This could be something usable for populating the name, But from what I see, the ButtonStyle and ButtonStyleConfiguration do not expose much. The only thing we could leverage is the ButtonRole, which can be cancel or destructive. Worth exploring tho 👍

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Very nice, it will be useful 👌

@ncreated ncreated merged commit 09299ce into master Nov 22, 2021
@ncreated ncreated deleted the ncreated/RUMM-1758-add-RUM-session-debug-utility branch November 22, 2021 13:03
@maxep maxep mentioned this pull request Dec 14, 2021
2 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.

3 participants