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

Discard unwanted automatic data earlier where possible #1280

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Jun 18, 2021

Goal

Improves performance by discarding unwanted automatic data as early as possible. In the happy case (where an error/session is discarded) then this will remove any overhead from gathering stacktraces/metadata, which should be a significant saving.

Changeset

The changeset has a lot of altered imports/reorganized tests so may be easier to view via the individual commits.

  • Moved ImmutableConfig to com.bugsnag.android.internal and consolidated all logic for discarding automatically captured data. This involved renaming and documenting some existing methods.
  • Made ImmutableConfig public (note it's under the internal package)
  • Moved existing checks to before the instantiation of the Event object. This now takes place at the point of error capture, and checks whether the Throwable itself is within the discardClasses or the errorClass for ANRs/JS/NDK errors
  • Moved checks to before the Session is instantiated, which avoids the collection of app/device metadata in SessionTracker
  • Avoided logging when events/sessions are discarded as this can be a hot path and writing to Logcat could become a bottleneck - E2E test assertions have been updated accordingly

Testing

Enhanced unit test coverage for discard logic.

This also relies on the existing E2E tests, specifically ignored_reports and release_stage. It's worth noting that these tests aren't exhaustive but are good enough to confirm that the functionality is working correctly.

@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Jun 18, 2021

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1512.7 1409.33
arm64_v8a 402.11 295.61
armeabi 385.72 279.22
armeabi_v7a 365.25 262.85
x86 443.05 336.55
x86_64 426.67 320.18

Generated by 🚫 Danger

@fractalwrench fractalwrench requested a review from lemnik June 18, 2021 16:32
@fractalwrench fractalwrench marked this pull request as ready for review June 18, 2021 16:32
@fractalwrench fractalwrench marked this pull request as draft June 18, 2021 17:13
@fractalwrench fractalwrench force-pushed the PLAT-6744/discard-events-earlier branch from c63ffc2 to 373f989 Compare June 21, 2021 08:55
@fractalwrench fractalwrench marked this pull request as ready for review June 21, 2021 09:22
@fractalwrench fractalwrench force-pushed the PLAT-6744/discard-events-earlier branch from 373f989 to b9c029f Compare June 21, 2021 15:14
@fractalwrench fractalwrench force-pushed the PLAT-6744/discard-events-earlier branch from b9c029f to fbaf782 Compare June 22, 2021 08:21
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench merged commit 8e31fab into next Jun 23, 2021
@fractalwrench fractalwrench deleted the PLAT-6744/discard-events-earlier branch June 23, 2021 08:42
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.

3 participants