Skip to content

[PoC] Invalid custom timing behavior#1

Closed
ken-kentan wants to merge 4 commits into
developfrom
kenkentan/debug
Closed

[PoC] Invalid custom timing behavior#1
ken-kentan wants to merge 4 commits into
developfrom
kenkentan/debug

Conversation

@ken-kentan

@ken-kentan ken-kentan commented May 24, 2023

Copy link
Copy Markdown
Owner

When we initialize Datadog SDK by using AndroidX Initializer and make some network call before any view started.
ApplicationLaunch view scope keeps remaining and cause unexpected custom timing event issue.

For example, when I want to measure a rendering performance for Jetpack Compose and use DD custom timing. The DD SDK will reports a custom timing not only for the target screen but also ApplicationLaunch scope...
Because somehow ApplicationLaunch scope still have a pending action and it won't be removed from active scopes.

- DatadogRumMonitor::addTiming(timing_test)
-- RumApplicationScope::handleEvent(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
-- RumApplicationScope::delegateToChildren(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
-- RumApplicationScope: childScopes(1): 
--- RumViewManagerScope::handleEvent(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
--- RumViewManagerScope::delegateToChildren(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
--- RumApplicationScope: childrenScopes(2): ApplicationLaunch, item
---- RumViewScope(ApplicationLaunch)::delegateToChildren(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
---- RumViewScope(ApplicationLaunch): isViewCompleteDebug(), true, true, (0, 1, 0, 0)
---- RumViewScope(item)::delegateToChildren(AddCustomTiming(name=timing_test, eventTime=Time(timestamp=1684905355877, nanoTime=72667052400314)))
---- RumViewScope(item): isViewCompleteDebug(), false, true, (0, 0, 0, 0)
ViewEvent! com/datadog/application-launch/view: CustomTimings(additionalProperties={timing_test=86033029082})
ViewEvent! item: CustomTimings(additionalProperties={timing_test=17310833})

In this scenario, an expected behavior is that only the item view scope reports the custom timing.

NOTE: This PR is a PoC to reproduce this reported issue. You can try to reproduce by running the sample Kotlin app.

@ken-kentan ken-kentan self-assigned this May 24, 2023
@ken-kentan ken-kentan changed the title Debug [PoC] Invalid custom timing behavior May 24, 2023
@ken-kentan ken-kentan closed this Jun 12, 2023
@ken-kentan
ken-kentan deleted the kenkentan/debug branch June 12, 2023 02:31
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.

1 participant