Skip to content
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

chore: Duplicate ANRTracker classes #4262

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Conversation

philipphofmann
Copy link
Member

This is the first step for #3492, which is part of the EPIC AppHang improvements #4261.

The changes for adding the option to ignore non-fully blocking app hangs are bloating up, and the PR would be huge. Instead, we first duplicate the AppHangTracker classes, and then we make smaller digestible PRs. Once we're happy with the AppHang changes, we delete the old V1 version and replace it with the new one. We could also run a beta with the V2 first before changing the algorithm for everyone.

#skip-changelog

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 97.35577% with 11 lines in your changes missing coverage. Please review.

Project coverage is 91.568%. Comparing base (d8cc6ae) to head (252e6a6).

Files Patch % Lines
...ions/ANR/SentryANRTrackingIntegrationV2Tests.swift 95.620% 6 Missing ⚠️
Sources/Sentry/SentryBaseIntegration.m 71.428% 2 Missing ⚠️
...sts/Integrations/ANR/SentryANRTrackerV2Tests.swift 98.518% 2 Missing ⚠️
Sources/Sentry/SentryANRTrackingIntegrationV2.m 97.500% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4262       +/-   ##
=============================================
+ Coverage   91.542%   91.568%   +0.026%     
=============================================
  Files          612       616        +4     
  Lines        49470     49886      +416     
  Branches     17916     18044      +128     
=============================================
+ Hits         45286     45680      +394     
- Misses        4091      4113       +22     
  Partials        93        93               
Files Coverage Δ
Sources/Sentry/SentryANRTrackerV2.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryDependencyContainer.m 96.153% <100.000%> (+0.235%) ⬆️
Sources/Sentry/SentryOptions.m 99.264% <100.000%> (+0.005%) ⬆️
...s/SentryTests/Helper/SentryTestThreadWrapper.swift 100.000% <100.000%> (ø)
Tests/SentryTests/SentryOptionsTest.m 97.902% <100.000%> (+0.002%) ⬆️
Sources/Sentry/SentryANRTrackingIntegrationV2.m 97.500% <97.500%> (ø)
Sources/Sentry/SentryBaseIntegration.m 95.238% <71.428%> (-1.701%) ⬇️
...sts/Integrations/ANR/SentryANRTrackerV2Tests.swift 98.518% <98.518%> (ø)
...ions/ANR/SentryANRTrackingIntegrationV2Tests.swift 95.620% <95.620%> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8cc6ae...252e6a6. Read the comment docs.

Copy link

github-actions bot commented Aug 8, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1210.81 ms 1229.29 ms 18.47 ms
Size 21.58 KiB 703.94 KiB 682.36 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e998fd0 1241.49 ms 1262.63 ms 21.14 ms
b15521e 1221.69 ms 1237.51 ms 15.82 ms
ef5821b 1253.18 ms 1265.46 ms 12.28 ms
533c68f 1236.54 ms 1256.68 ms 20.14 ms
4ae9b7a 1223.94 ms 1243.90 ms 19.96 ms
5230990 1222.86 ms 1243.59 ms 20.73 ms
bd2afa6 1241.37 ms 1246.20 ms 4.83 ms
189b629 1211.16 ms 1224.30 ms 13.14 ms
3f1be0f 1208.12 ms 1225.72 ms 17.60 ms
3de9971 1224.38 ms 1245.33 ms 20.95 ms

App size

Revision Plain With Sentry Diff
e998fd0 21.58 KiB 414.59 KiB 393.01 KiB
b15521e 21.58 KiB 573.17 KiB 551.59 KiB
ef5821b 21.58 KiB 414.96 KiB 393.37 KiB
533c68f 21.58 KiB 630.28 KiB 608.70 KiB
4ae9b7a 21.58 KiB 632.04 KiB 610.46 KiB
5230990 21.58 KiB 682.39 KiB 660.81 KiB
bd2afa6 20.76 KiB 420.55 KiB 399.79 KiB
189b629 20.76 KiB 399.69 KiB 378.93 KiB
3f1be0f 20.76 KiB 414.44 KiB 393.69 KiB
3de9971 21.58 KiB 574.17 KiB 552.59 KiB

Previous results on branch: feat/non-fatal-app-hangs

Startup times

Revision Plain With Sentry Diff
ec40ccd 1228.87 ms 1245.30 ms 16.43 ms

App size

Revision Plain With Sentry Diff
ec40ccd 21.58 KiB 703.94 KiB 682.36 KiB

Copy link
Contributor

@brustolin brustolin 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. There's not much to review other than the duplication. However, I would keep this PR open and merge the other changes related to ANR into this one, so we don't make a release with this duplication.

Something that I believe fits this PR is a protection to avoid enabling both integrations at the same time. Users should either use V1 or V2

@philipphofmann
Copy link
Member Author

philipphofmann commented Aug 12, 2024

However, I would keep this PR open and merge the other changes related to ANR into this one, so we don't make a release with this duplication.

The downside with that approach is that we could run into possible merge conflicts, and I need to merge main multiple times into this branch. I wouldn't worry too much about the duplication. It's around 500 lines of code.

Something that I believe fits this PR is a protection to avoid enabling both integrations at the same time. Users should either use V1 or V2

The option V2 is currently in SentryOptions+Private.h, so nobody can enable it. I will ensure that this can't happen in an upcoming PR. Then it's also easier to review. Furthermore, we might just swap V1 with V2 and not offer the possibility of having both.

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

I would prefer that some changes be made to the classes already. I will leave this to your discretion.

@philipphofmann philipphofmann merged commit e0abb7e into main Aug 12, 2024
64 of 65 checks passed
@philipphofmann philipphofmann deleted the feat/non-fatal-app-hangs branch August 12, 2024 13:30
@philipphofmann philipphofmann self-assigned this Sep 23, 2024
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.

2 participants