Skip to content

TTID/TTFD Improvements #2866

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

Open
wants to merge 58 commits into
base: main
Choose a base branch
from
Open

TTID/TTFD Improvements #2866

wants to merge 58 commits into from

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Apr 15, 2025

📜 Description

  • Adds a SentryDisplay with reportFullyDisplayed, fixing TTFD improvements #2852
  • Adds SentryDisplayWidget to wrap SentryDisplay
  • Refactoring
    • Remove global singleton instances for TTID/TTFD trackers
    • Remove redundant startTimestamp
    • Inject options in TTFD tracker instead of using static
  • Fixes an issue where root screen ttfd could not be reported

💡 Motivation and Context

Closes #2852

💚 How did you test it?

Unit tests

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 93.24324% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.10%. Comparing base (4f9a5e9) to head (66115cd).

Files with missing lines Patch % Lines
flutter/lib/src/sentry_flutter.dart 55.55% 4 Missing ⚠️
flutter/lib/src/navigation/sentry_display.dart 75.00% 2 Missing ⚠️
...tter/lib/src/navigation/sentry_display_widget.dart 89.47% 2 Missing ⚠️
...b/src/navigation/time_to_full_display_tracker.dart 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2866      +/-   ##
==========================================
+ Coverage   87.65%   89.10%   +1.44%     
==========================================
  Files         272       95     -177     
  Lines        9047     3101    -5946     
==========================================
- Hits         7930     2763    -5167     
+ Misses       1117      338     -779     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@denrase denrase marked this pull request as ready for review April 15, 2025 15:59
Copy link
Contributor

github-actions bot commented Apr 15, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1244.18 ms 1259.65 ms 15.47 ms
Size 8.43 MiB 10.01 MiB 1.58 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
5e8d2b3 1255.71 ms 1267.98 ms 12.27 ms
051e97a 1245.94 ms 1249.51 ms 3.57 ms
07cd9e8 1237.04 ms 1257.50 ms 20.46 ms
7fd33d3 1241.92 ms 1265.47 ms 23.55 ms
a24a1db 1257.71 ms 1271.57 ms 13.87 ms
5aa047a 1236.57 ms 1241.02 ms 4.45 ms
abfcdb5 1230.87 ms 1244.94 ms 14.06 ms
7659cbe 1246.70 ms 1265.88 ms 19.17 ms
4d046e0 1243.08 ms 1255.98 ms 12.90 ms
bd1b990 1209.43 ms 1226.96 ms 17.53 ms

App size

Revision Plain With Sentry Diff
5e8d2b3 8.29 MiB 9.36 MiB 1.07 MiB
051e97a 8.28 MiB 9.34 MiB 1.06 MiB
07cd9e8 8.38 MiB 9.77 MiB 1.40 MiB
7fd33d3 8.38 MiB 9.78 MiB 1.40 MiB
a24a1db 8.42 MiB 9.91 MiB 1.49 MiB
5aa047a 8.29 MiB 9.39 MiB 1.10 MiB
abfcdb5 8.33 MiB 9.64 MiB 1.31 MiB
7659cbe 8.42 MiB 9.89 MiB 1.47 MiB
4d046e0 8.42 MiB 9.83 MiB 1.40 MiB
bd1b990 8.32 MiB 9.38 MiB 1.06 MiB

Previous results on branch: enha/ttfd-tracking-imporvements

Startup times

Revision Plain With Sentry Diff
129b785 1258.48 ms 1268.57 ms 10.10 ms
b4bfadb 1244.46 ms 1269.89 ms 25.43 ms
18daedc 1252.35 ms 1266.81 ms 14.46 ms
e6c151d 1265.26 ms 1276.04 ms 10.79 ms
13c4582 1265.98 ms 1278.06 ms 12.08 ms
64a71da 1245.57 ms 1264.22 ms 18.65 ms
80a3789 1247.35 ms 1249.75 ms 2.40 ms
abf0025 1248.33 ms 1264.54 ms 16.21 ms
cfec46d 1275.14 ms 1287.55 ms 12.41 ms
31c6c6b 1267.96 ms 1282.86 ms 14.90 ms

App size

Revision Plain With Sentry Diff
129b785 8.43 MiB 10.01 MiB 1.58 MiB
b4bfadb 8.43 MiB 10.01 MiB 1.58 MiB
18daedc 8.43 MiB 10.01 MiB 1.58 MiB
e6c151d 8.43 MiB 10.01 MiB 1.58 MiB
13c4582 8.43 MiB 10.01 MiB 1.58 MiB
64a71da 8.43 MiB 10.01 MiB 1.58 MiB
80a3789 8.43 MiB 10.01 MiB 1.58 MiB
abf0025 8.43 MiB 10.01 MiB 1.58 MiB
cfec46d 8.43 MiB 10.01 MiB 1.58 MiB
31c6c6b 8.43 MiB 10.01 MiB 1.58 MiB

Copy link
Contributor

github-actions bot commented Apr 15, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 481.67 ms 505.76 ms 24.09 ms
Size 6.44 MiB 7.43 MiB 1012.18 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
04db237 330.16 ms 428.38 ms 98.22 ms
4477d2e 392.75 ms 472.69 ms 79.94 ms
1596141 300.92 ms 368.94 ms 68.02 ms
e2d89fc 323.84 ms 376.23 ms 52.39 ms
3334ac1 303.98 ms 366.65 ms 62.67 ms
9d7e862 426.35 ms 510.88 ms 84.53 ms
5cc82a0 400.35 ms 474.52 ms 74.17 ms
61e71ec 343.94 ms 410.59 ms 66.66 ms
24b6e60 440.64 ms 557.96 ms 117.32 ms
04bd9e6 402.06 ms 483.56 ms 81.50 ms

App size

Revision Plain With Sentry Diff
04db237 5.94 MiB 6.95 MiB 1.01 MiB
4477d2e 6.33 MiB 7.26 MiB 950.38 KiB
1596141 6.16 MiB 7.14 MiB 1003.98 KiB
e2d89fc 6.06 MiB 7.03 MiB 989.37 KiB
3334ac1 6.06 MiB 7.03 MiB 993.54 KiB
9d7e862 6.33 MiB 7.26 MiB 943.41 KiB
5cc82a0 6.34 MiB 7.28 MiB 966.66 KiB
61e71ec 6.34 MiB 7.28 MiB 966.26 KiB
24b6e60 6.33 MiB 7.26 MiB 950.14 KiB
04bd9e6 6.35 MiB 7.34 MiB 1008.33 KiB

Previous results on branch: enha/ttfd-tracking-imporvements

Startup times

Revision Plain With Sentry Diff
e6c151d 505.14 ms 561.90 ms 56.76 ms
13c4582 426.02 ms 493.63 ms 67.61 ms
22dfd2b 452.07 ms 511.98 ms 59.91 ms
4e48bc7 482.65 ms 549.28 ms 66.63 ms
31c6c6b 433.30 ms 489.52 ms 56.22 ms
129b785 527.02 ms 528.60 ms 1.58 ms
cfec46d 485.43 ms 550.69 ms 65.27 ms
9287f30 471.57 ms 513.60 ms 42.03 ms
4aca1fa 463.57 ms 513.39 ms 49.83 ms
abf0025 504.36 ms 558.93 ms 54.57 ms

App size

Revision Plain With Sentry Diff
e6c151d 6.44 MiB 7.43 MiB 1010.10 KiB
13c4582 6.44 MiB 7.43 MiB 1012.17 KiB
22dfd2b 6.44 MiB 7.43 MiB 1011.88 KiB
4e48bc7 6.44 MiB 7.43 MiB 1012.23 KiB
31c6c6b 6.44 MiB 7.43 MiB 1012.22 KiB
129b785 6.44 MiB 7.43 MiB 1012.19 KiB
cfec46d 6.44 MiB 7.43 MiB 1012.20 KiB
9287f30 6.44 MiB 7.43 MiB 1010.45 KiB
4aca1fa 6.44 MiB 7.43 MiB 1011.88 KiB
abf0025 6.44 MiB 7.43 MiB 1012.19 KiB

Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

I believe there's still the issue of the async calls not being awaited - finish and start time to display in didPush

@buenaflor
Copy link
Contributor

as discussed let's find a more user friendly way to solve this. perhaps through a widget

@denrase denrase requested a review from buenaflor April 17, 2025 13:11
@buenaflor
Copy link
Contributor

As discussed let's try to use the spanId similar to react native

Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

I like the approach manual and widget approach!

let's try and figure out how to handle the root transactions.

maybe it makes sense to have a central place where the navigator and the app start fetches the transaction from

@denrase denrase requested a review from ueman April 30, 2025 10:07
Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

Looks good so far, I'll do another in-depth pass later.

@denrase denrase requested a review from buenaflor May 5, 2025 08:07
@denrase denrase requested a review from buenaflor May 6, 2025 11:36
@denrase denrase requested a review from buenaflor May 6, 2025 14:20
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.

TTFD improvements
3 participants