getsentry / sentry-dart

Sentry SDK for Dart and Flutter
https://sentry.io/for/flutter/
MIT License
754 stars 237 forks source link

Provide a way to cause an example native crash from Flutter #2239

Closed martinhaintz closed 2 months ago

martinhaintz commented 2 months ago

:scroll: Description

add SentryFlutter.nativeCrash() using MethodChannels for Android and iOS

:bulb: Motivation and Context

close #219

:green_heart: How did you test it?

Android Emulator and iOS Simulator. Also, I added a SentryFlutter.nativeCrash button to the example app.

:pencil: Checklist

github-actions[bot] commented 2 months ago
Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 22c210ee39133f18bfe4cbec42557f6abc1324a3

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.60%. Comparing base (256df44) to head (22c210e). Report is 1 commits behind head on main.

Files Patch % Lines
flutter/lib/src/sentry_flutter.dart 55.55% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2239 +/- ## ========================================== + Coverage 88.24% 91.60% +3.36% ========================================== Files 235 64 -171 Lines 8148 2084 -6064 ========================================== - Hits 7190 1909 -5281 + Misses 958 175 -783 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 2 months ago

Android Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 441.63 ms 476.66 ms 35.03 ms
Size 6.52 MiB 7.59 MiB 1.06 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
90db9ff6c609bc213a723fd0f6bbdcede4b98722 334.86 ms 388.14 ms 53.28 ms
95c69e3311709c4a455d2c8b8d964ad11fc6fdd7 379.93 ms 441.96 ms 62.02 ms
ba9c106515fc2731497c7e40c2ea0f885336884a 383.10 ms 454.22 ms 71.12 ms
ae0263294aa289445fd162ceb85a18ede257e8fd 309.16 ms 348.98 ms 39.82 ms
891efac7482a4b10381a811967c97b042d097734 378.00 ms 461.20 ms 83.20 ms
d0312c9616494d7365a21482a4564461e3bbd14d 354.78 ms 411.53 ms 56.75 ms
11fb40841ad3d6fc46e02eb8adeb74d5b6932582 320.10 ms 380.24 ms 60.14 ms
eecbbcabbbe00a5dcc7d42cd6334f771a20b547f 324.37 ms 352.49 ms 28.12 ms
2966d88d828c6e2604b15b95f0d0d958acc2cc68 365.71 ms 422.50 ms 56.79 ms
ef6466d86186e2932eabfe1ae89db71f31313787 373.96 ms 443.17 ms 69.21 ms

App size

Revision Plain With Sentry Diff
90db9ff6c609bc213a723fd0f6bbdcede4b98722 6.06 MiB 7.10 MiB 1.04 MiB
95c69e3311709c4a455d2c8b8d964ad11fc6fdd7 6.35 MiB 7.35 MiB 1021.71 KiB
ba9c106515fc2731497c7e40c2ea0f885336884a 6.33 MiB 7.27 MiB 954.12 KiB
ae0263294aa289445fd162ceb85a18ede257e8fd 5.94 MiB 6.95 MiB 1.01 MiB
891efac7482a4b10381a811967c97b042d097734 6.27 MiB 7.20 MiB 958.73 KiB
d0312c9616494d7365a21482a4564461e3bbd14d 6.33 MiB 7.26 MiB 949.76 KiB
11fb40841ad3d6fc46e02eb8adeb74d5b6932582 6.06 MiB 7.10 MiB 1.04 MiB
eecbbcabbbe00a5dcc7d42cd6334f771a20b547f 5.94 MiB 6.89 MiB 975.78 KiB
2966d88d828c6e2604b15b95f0d0d958acc2cc68 6.33 MiB 7.27 MiB 954.11 KiB
ef6466d86186e2932eabfe1ae89db71f31313787 6.34 MiB 7.28 MiB 967.79 KiB

Previous results on branch: feat/example-native-crash-from-flutter

Startup times

Revision Plain With Sentry Diff
59341c425fc32028241eb2a5785bf238fdddfaea 444.08 ms 484.58 ms 40.50 ms
f71ceb8afde531cb7adcadf0a4fc95c54d2f232b 389.37 ms 449.16 ms 59.79 ms
38d0ea5401a3ea3156c5684698bafc9802d51284 425.76 ms 463.98 ms 38.22 ms

App size

Revision Plain With Sentry Diff
59341c425fc32028241eb2a5785bf238fdddfaea 6.52 MiB 7.59 MiB 1.06 MiB
f71ceb8afde531cb7adcadf0a4fc95c54d2f232b 6.52 MiB 7.59 MiB 1.06 MiB
38d0ea5401a3ea3156c5684698bafc9802d51284 6.52 MiB 7.59 MiB 1.06 MiB
github-actions[bot] commented 2 months ago

iOS Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1249.51 ms 1275.72 ms 26.21 ms
Size 8.38 MiB 9.71 MiB 1.33 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0db91ccbfaec953eb629db000f6a6034aa04e2c8 1267.63 ms 1279.69 ms 12.06 ms
9d43f714e4f8a4fdf68e41799b520c6f7d0514b9 1225.06 ms 1227.06 ms 2.00 ms
5112c69cbabc27fdee43278e7fae250aa56d0120 1272.76 ms 1293.37 ms 20.61 ms
b2cbbc84b2f678fc917653a40dd14335ee16b9c2 1240.00 ms 1254.37 ms 14.37 ms
a510d1dcfc21014ab20a3aab783acc9f1fa9091c 1277.04 ms 1291.57 ms 14.53 ms
04db237c887e97fd4e5843a50e97135e2e03ce53 1273.29 ms 1306.50 ms 33.21 ms
df16b96fceb6ce836e4d52d33120d7b1d922d5a7 1255.24 ms 1259.40 ms 4.16 ms
25161f47b02abb67b61b15fa4b63028dc5298069 1252.35 ms 1263.84 ms 11.49 ms
cfa25fc88f8dfc0907b0f6ac9ddd0a5cbb14c3c1 1251.77 ms 1275.69 ms 23.92 ms
32fa6b6dfa01faefdbad4b1bb6425b38214c1e7f 1226.21 ms 1251.78 ms 25.57 ms

App size

Revision Plain With Sentry Diff
0db91ccbfaec953eb629db000f6a6034aa04e2c8 8.15 MiB 9.15 MiB 1018.56 KiB
9d43f714e4f8a4fdf68e41799b520c6f7d0514b9 8.29 MiB 9.39 MiB 1.10 MiB
5112c69cbabc27fdee43278e7fae250aa56d0120 8.16 MiB 9.17 MiB 1.01 MiB
b2cbbc84b2f678fc917653a40dd14335ee16b9c2 8.10 MiB 9.18 MiB 1.08 MiB
a510d1dcfc21014ab20a3aab783acc9f1fa9091c 8.16 MiB 9.17 MiB 1.01 MiB
04db237c887e97fd4e5843a50e97135e2e03ce53 8.15 MiB 9.13 MiB 1003.16 KiB
df16b96fceb6ce836e4d52d33120d7b1d922d5a7 8.10 MiB 9.16 MiB 1.06 MiB
25161f47b02abb67b61b15fa4b63028dc5298069 8.28 MiB 9.34 MiB 1.06 MiB
cfa25fc88f8dfc0907b0f6ac9ddd0a5cbb14c3c1 8.32 MiB 9.43 MiB 1.10 MiB
32fa6b6dfa01faefdbad4b1bb6425b38214c1e7f 8.33 MiB 9.64 MiB 1.31 MiB

Previous results on branch: feat/example-native-crash-from-flutter

Startup times

Revision Plain With Sentry Diff
59341c425fc32028241eb2a5785bf238fdddfaea 1250.10 ms 1274.30 ms 24.19 ms
f71ceb8afde531cb7adcadf0a4fc95c54d2f232b 1257.67 ms 1272.38 ms 14.70 ms
38d0ea5401a3ea3156c5684698bafc9802d51284 1258.41 ms 1285.83 ms 27.42 ms

App size

Revision Plain With Sentry Diff
59341c425fc32028241eb2a5785bf238fdddfaea 8.38 MiB 9.71 MiB 1.33 MiB
f71ceb8afde531cb7adcadf0a4fc95c54d2f232b 8.38 MiB 9.71 MiB 1.33 MiB
38d0ea5401a3ea3156c5684698bafc9802d51284 8.38 MiB 9.71 MiB 1.33 MiB