Skip to content

Commit 018ffc2

Browse files
committed
fix(samples): Measure Nav3 effect after application
Record the performance sample from a SideEffect so the SentryNavEffect DisposableEffect and its extractors have completed before timing is captured.\n\nCo-Authored-By: Codex <noreply@openai.com>
1 parent a80d21b commit 018ffc2

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

  • sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/navigation/nav3

‎sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/navigation/nav3/Nav3Activity.kt‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,19 @@ private fun Nav3SampleApp(
307307
)
308308

309309
if (isPerformanceScenario) {
310-
performanceState.recordSentryNavEffect(
311-
durationNanos = System.nanoTime() - startedAtNanos,
312-
extractorNanosBefore = extractorNanosBefore,
313-
processedCall = true,
314-
resolvedEntryCount =
315-
if (integrationMode.captureBackStack) {
316-
minOf(sentryBackStack.size, maxCapturedBackStackEntries)
317-
} else {
318-
0
319-
},
320-
)
310+
SideEffect {
311+
performanceState.recordSentryNavEffect(
312+
durationNanos = System.nanoTime() - startedAtNanos,
313+
extractorNanosBefore = extractorNanosBefore,
314+
processedCall = true,
315+
resolvedEntryCount =
316+
if (integrationMode.captureBackStack) {
317+
minOf(sentryBackStack.size, maxCapturedBackStackEntries)
318+
} else {
319+
0
320+
},
321+
)
322+
}
321323
}
322324
}
323325

0 commit comments

Comments
 (0)