-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add blocked_main_thread
to sync file spans
#1801
base: main
Are you sure you want to change the base?
Conversation
Android Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
636cb61 | 366.59 ms | 448.14 ms | 81.55 ms |
4b29d6e | 386.80 ms | 430.86 ms | 44.06 ms |
0be962b | 325.54 ms | 382.83 ms | 57.29 ms |
7f75f32 | 347.36 ms | 419.58 ms | 72.22 ms |
64e4616 | 349.82 ms | 436.96 ms | 87.14 ms |
683fd34 | 336.53 ms | 418.10 ms | 81.57 ms |
a7acb24 | 301.00 ms | 357.38 ms | 56.38 ms |
8932ece | 309.56 ms | 377.28 ms | 67.72 ms |
1b66358 | 314.96 ms | 363.39 ms | 48.43 ms |
df16b96 | 326.08 ms | 391.82 ms | 65.74 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
636cb61 | 6.27 MiB | 7.20 MiB | 959.08 KiB |
4b29d6e | 6.33 MiB | 7.26 MiB | 946.14 KiB |
0be962b | 6.06 MiB | 7.03 MiB | 990.29 KiB |
7f75f32 | 6.26 MiB | 7.20 MiB | 959.18 KiB |
64e4616 | 6.27 MiB | 7.20 MiB | 956.52 KiB |
683fd34 | 6.27 MiB | 7.20 MiB | 960.43 KiB |
a7acb24 | 5.94 MiB | 6.95 MiB | 1.01 MiB |
8932ece | 6.16 MiB | 7.13 MiB | 1000.89 KiB |
1b66358 | 6.06 MiB | 7.09 MiB | 1.03 MiB |
df16b96 | 6.06 MiB | 7.03 MiB | 988.94 KiB |
Previous results on branch: enha/file-isolate-name
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
906e92a | 619.53 ms | 714.16 ms | 94.63 ms |
7e4b32b | 445.00 ms | 546.73 ms | 101.73 ms |
053d6e5 | 379.48 ms | 430.35 ms | 50.87 ms |
03663b0 | 407.98 ms | 502.52 ms | 94.54 ms |
53df9a1 | 377.64 ms | 453.04 ms | 75.40 ms |
1627c58 | 335.62 ms | 413.39 ms | 77.77 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
906e92a | 6.33 MiB | 7.26 MiB | 950.38 KiB |
7e4b32b | 6.33 MiB | 7.26 MiB | 950.12 KiB |
053d6e5 | 6.33 MiB | 7.26 MiB | 949.77 KiB |
03663b0 | 6.33 MiB | 7.26 MiB | 950.37 KiB |
53df9a1 | 6.33 MiB | 7.26 MiB | 949.77 KiB |
1627c58 | 6.33 MiB | 7.26 MiB | 950.14 KiB |
iOS Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
117d988 | 1200.83 ms | 1223.24 ms | 22.41 ms |
955541a | 1230.22 ms | 1252.96 ms | 22.73 ms |
f83bc1d | 1247.12 ms | 1249.78 ms | 2.65 ms |
5e8d2b3 | 1255.71 ms | 1267.98 ms | 12.27 ms |
86d4841 | 1225.69 ms | 1241.12 ms | 15.43 ms |
68677de | 1245.20 ms | 1273.51 ms | 28.31 ms |
3de8b9b | 1234.22 ms | 1251.94 ms | 17.72 ms |
1cdcacf | 1208.35 ms | 1235.13 ms | 26.77 ms |
0ceb89c | 1252.02 ms | 1271.78 ms | 19.75 ms |
8932ece | 1234.31 ms | 1238.90 ms | 4.59 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
117d988 | 8.32 MiB | 9.38 MiB | 1.05 MiB |
955541a | 8.28 MiB | 9.34 MiB | 1.06 MiB |
f83bc1d | 8.28 MiB | 9.34 MiB | 1.05 MiB |
5e8d2b3 | 8.29 MiB | 9.36 MiB | 1.07 MiB |
86d4841 | 8.29 MiB | 9.36 MiB | 1.07 MiB |
68677de | 8.10 MiB | 9.16 MiB | 1.07 MiB |
3de8b9b | 8.28 MiB | 9.34 MiB | 1.06 MiB |
1cdcacf | 8.32 MiB | 9.39 MiB | 1.06 MiB |
0ceb89c | 8.15 MiB | 9.12 MiB | 989.78 KiB |
8932ece | 8.29 MiB | 9.36 MiB | 1.07 MiB |
Previous results on branch: enha/file-isolate-name
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
906e92a | 1226.29 ms | 1247.96 ms | 21.67 ms |
7e4b32b | 1296.69 ms | 1352.51 ms | 55.82 ms |
03663b0 | 1242.71 ms | 1265.73 ms | 23.01 ms |
53df9a1 | 1214.55 ms | 1242.00 ms | 27.45 ms |
1627c58 | 1215.58 ms | 1229.35 ms | 13.76 ms |
053d6e5 | 1207.80 ms | 1227.45 ms | 19.65 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
906e92a | 8.32 MiB | 9.38 MiB | 1.06 MiB |
7e4b32b | 8.32 MiB | 9.38 MiB | 1.06 MiB |
03663b0 | 8.32 MiB | 9.38 MiB | 1.06 MiB |
53df9a1 | 8.32 MiB | 9.39 MiB | 1.06 MiB |
1627c58 | 8.32 MiB | 9.38 MiB | 1.06 MiB |
053d6e5 | 8.32 MiB | 9.38 MiB | 1.06 MiB |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1801 +/- ##
==========================================
- Coverage 91.17% 88.55% -2.63%
==========================================
Files 172 207 +35
Lines 5418 6901 +1483
==========================================
+ Hits 4940 6111 +1171
- Misses 478 790 +312 ☔ View full report in Codecov by Sentry. |
@buenaflor I'm not sure we can guarantee that the |
@denrase do we know any scenarios where it won't work? |
Probably when someone calls |
Got it, If we can't guarantee that it's always correct maybe it should be opt-in?
https://docs.sentry.io/product/issues/issue-details/performance-issues/file-main-thread-io/ it should already be in place and all we need is to add the correct span data. If I looked correctly it should be
|
blocked_main_thread
name to sync file spans
blocked_main_thread
name to sync file spansblocked_main_thread
to sync file spans
@buenaflor Think i found a good solution. Added a callback to options to check for the main Isolate. When using the |
I guess we need to fall back to Maybe we can leverage the dynamic - NoSuchMethod approach again here? |
@buenaflor It looks like this won't work in this case, as this is a static property on on Is there another way to check this? 🤔 If not, it looks like we can only fall back to the Isolate debug name. |
@buenaflor Removed |
All |
@marandaneto I checked and Flutter So I'm guessig that flutter versions < I have not seen the class definition in other repositories, expept in I wanted to test this and downgrade to Flutter 3, but with no luck so far on macOS. |
|
Like expected, we do not have access to
|
@denrase background isolates is Flutter >= 3.7 |
@@ -657,6 +657,286 @@ void main() { | |||
); | |||
}); | |||
}); | |||
|
|||
group('$SentryFile span sets `blocked_main_thread`', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests are using the isMainIsolate
fake but not starting a real background isolate and reading a file from it to verify that indeed returns true
or false
correctly.
So it is hard to tell that the solution works.
I'd write a test that creates a background isolate and wait for its result, and asserting that the span contains the right result.
This test could be done on the flutter integration test for example if needs to be, or even the example app, since there the flutter min. version is higher or can be higher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two tests to the example app. The first runs on the main isolate and the second init's sentry only on a bg isolate and runs there. Results as expected, thx for the suggestion! 👍
@marandaneto Exactly.
Only way as I see it to reliably and automatically detect this is to bump to Flutter |
@buenaflor The PR still has the caveat that users might override the |
Let's keep this blocked by flutter min 3.7 wdyt? @denrase |
@buenaflor Sounds good to me. 👍 |
📜 Description
Add
blocked_main_thread
to sync file spans💡 Motivation and Context
Relates to #1727
💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPii
is enabled