Skip to content

Conversation

@markushi
Copy link
Member

@markushi markushi commented Dec 4, 2025

📜 Description

Adds log flushing functionality that triggers when the Android app transitions to the background.

In favor of the more complicated old PR #4873

💡 Motivation and Context

Reduced data loss

💚 How did you test it?

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a991803

@markushi
Copy link
Member Author

markushi commented Dec 4, 2025

@sentry review

Comment on lines 26 to 32

public final class LoggerBatchProcessor implements ILoggerBatchProcessor {
@Open
public class LoggerBatchProcessor implements ILoggerBatchProcessor {

public static final int FLUSH_AFTER_MS = 5000;
public static final int MAX_BATCH_SIZE = 100;
public static final int MAX_QUEUE_SIZE = 1000;

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 309.49 ms 369.27 ms 59.78 ms
Size 1.58 MiB 2.13 MiB 558.99 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
abfcc92 337.38 ms 427.39 ms 90.00 ms
ce0a49e 532.00 ms 609.96 ms 77.96 ms
3998a95 415.94 ms 478.54 ms 62.60 ms
f634d01 375.06 ms 420.04 ms 44.98 ms
674d437 355.28 ms 504.18 ms 148.90 ms
ee747ae 374.71 ms 455.18 ms 80.47 ms
bbc35bb 324.88 ms 425.73 ms 100.85 ms
3d205d0 352.15 ms 432.53 ms 80.38 ms
d364ace 411.72 ms 430.81 ms 19.10 ms
ee747ae 382.73 ms 435.41 ms 52.68 ms

App size

Revision Plain With Sentry Diff
abfcc92 1.58 MiB 2.13 MiB 557.31 KiB
ce0a49e 1.58 MiB 2.10 MiB 532.94 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
f634d01 1.58 MiB 2.10 MiB 533.40 KiB
674d437 1.58 MiB 2.10 MiB 530.94 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB

Previous results on branch: markushi/feat/android-app-lifecycle-log-flushing-2

Startup times

Revision Plain With Sentry Diff
4fc0d17 345.00 ms 364.09 ms 19.09 ms
79a3c33 302.67 ms 371.61 ms 68.94 ms

App size

Revision Plain With Sentry Diff
4fc0d17 1.58 MiB 2.13 MiB 558.99 KiB
79a3c33 1.58 MiB 2.13 MiB 559.00 KiB

Copy link
Member

@romtsn romtsn 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, thanks for reworking it, looks much cleaner now! 👨‍🍳

@markushi markushi merged commit 2ab9d50 into main Dec 4, 2025
61 of 62 checks passed
@markushi markushi deleted the markushi/feat/android-app-lifecycle-log-flushing-2 branch December 4, 2025 11:40
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