Skip to content

perf(perps): add app-to-homepage timing cohorts - #34947

Closed
abretonc7s wants to merge 11 commits into
perf/perps-bootstrap-mobilefrom
perf/perps-sentry-homepage-stack
Closed

perf(perps): add app-to-homepage timing cohorts#34947
abretonc7s wants to merge 11 commits into
perf/perps-bootstrap-mobilefrom
perf/perps-sentry-homepage-stack

Conversation

@abretonc7s

Copy link
Copy Markdown
Contributor

Description

Stack 1 of the Perps performance instrumentation, based on #34934. Reuses existing Homepage Ready, Authenticate User, Homepage TTC, and Homepage DFD traces; adds only the missing auth-end-to-ready measurement, completion subscription, and bounded cohort tags.

The architecture/runbook/Sentry contract documents the two clocks and three parallel Perps lanes. It contains no measured values.

Stack

Validation

  • HomepageReady, Login, and useSectionPerformance suites: PASS
  • Targeted ESLint: 0 errors
  • Prettier and diff checks: PASS
  • Non-documentation diff is below the 1,000-line CI limit

Dashboard

Development dashboard: https://metamask.sentry.io/dashboard/9338822/?environment=development&project=2651591&statsPeriod=14d
Archived previous layout: https://metamask.sentry.io/dashboard/9625684/
Shared dashboard 3948326 remains unchanged.

Related issues

Jira: https://consensyssoftware.atlassian.net/browse/TAT-3662
Core observability follow-up: MetaMask/core#9906

@abretonc7s abretonc7s self-assigned this Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added size-L and removed size-M labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: @PerformanceLogin, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePreps
  • Risk Level: low
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR changes are entirely in performance telemetry/instrumentation code with no user-facing behavioral changes:

  1. HomepageReady.ts: Adds markHomepageAuthenticationEnd() (records auth-end timestamp for Sentry measurement), subscribeHomepageReadyCompletion() (pub/sub for homepage ready events), and notifyHomepageReadyCompletion(). These are purely observational additions that don't alter any existing control flow.

  2. useSectionPerformance.ts: Extends the hook with optional tags and data props for bounded cohort metadata on Sentry traces. Existing behavior is unchanged when these props are not provided.

  3. Login/index.tsx: Adds a single markHomepageAuthenticationEnd(homepageReadyTraceToken) call after successful unlock. The implementation is fully defensive (null checks, finite number checks) and cannot throw or affect the unlock flow.

  4. OAuthRehydration/index.tsx: Same pattern - adds markHomepageAuthenticationEnd() after successful OAuth rehydration. No behavioral change to the unlock flow.

  5. Test files: Unit tests for all the above - no E2E impact.

  6. docs/perps/performance/: Pure documentation - no functional impact.

None of these changes affect user-visible UI, navigation, business logic, or any shared components (TabBar, modals, confirmations, browser). There is no risk of breaking existing E2E smoke tests. No E2E smoke tags are warranted.

Performance Test Selection:
The PR directly instruments performance-sensitive flows:

  1. @PerformanceLogin: Login/index.tsx and OAuthRehydration/index.tsx both add markHomepageAuthenticationEnd() calls in the unlock success path. This new measurement (authentication_end_to_homepage_ready_ms) is specifically designed to capture the auth-to-homepage duration in the unlock cohort. Performance login tests exercise exactly this path and should validate the instrumentation works correctly without regression.

  2. @PerformanceLaunch: HomepageReady.ts adds notifyHomepageReadyCompletion() and subscribeHomepageReadyCompletion() which fire on every homepage ready completion (both cold app_open and unlock). The latestHomepageReadyAtMs state management and lifecycle reset logic could affect how launch performance is measured. Performance launch tests cover cold start and warm start scenarios.

  3. @PerformanceAssetLoading: useSectionPerformance.ts is extended with tags and data props that are now spread into trace start/end calls. This hook is used by homepage sections (tokens, NFTs, etc.) that are measured by asset loading performance tests. The dependency array changes (data added to useEffect deps) could affect when traces end.

  4. @PerformancePreps: The ARCHITECTURE.md documents the Perps performance measurement architecture that explicitly references useSectionPerformance for Homepage Perps TTC/DFD, and the subscribeHomepageReadyCompletion API for the Perps loading session coordinator. The tags/data extension to useSectionPerformance is specifically designed for Perps cohort metadata (lifecycle, content_variant, market_source, account_source, perps_session_id). Running Perps performance tests validates this instrumentation foundation.

View GitHub Actions results

@abretonc7s

Copy link
Copy Markdown
Contributor Author

Consolidated into #34948 to keep the Mobile delivery chain minimal. All reviewed Homepage/Sentry commits are preserved there.

@abretonc7s abretonc7s closed this Aug 18, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant