DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
150 stars 59 forks source link

RUM-3597: Start sending batches immediately after feature is initialized #1991

Closed 0xnm closed 6 months ago

0xnm commented 6 months ago

What does this PR do?

This change removes initial delay for start sending batches, now they the first upload will be triggered right after the feature is initialized instead of waiting for some delay.

This allows to submit more data in case if application is crashing early.

The downside is that there is a chance that first batch uploaded won't be sent to the batch upload metrics telemetry, because RUM monitor may be not ready yet, but this is acceptable.

Review checklist (to be filled by reviewers)

codecov-commenter commented 6 months ago

Codecov Report

Merging #1991 (8998bda) into develop (71dab01) will increase coverage by 0.10%. Report is 2 commits behind head on develop. The diff coverage is 100.00%.

:exclamation: Current head 8998bda differs from pull request most recent head ae36cdc. Consider uploading reports for the commit ae36cdc to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1991 +/- ## =========================================== + Coverage 83.64% 83.74% +0.10% =========================================== Files 488 488 Lines 17771 17773 +2 Branches 2666 2666 =========================================== + Hits 14863 14883 +20 + Misses 2183 2167 -16 + Partials 725 723 -2 ``` | [Files](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/1991?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [...in/com/datadog/android/core/internal/SdkFeature.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/1991?src=pr&el=tree&filepath=dd-sdk-android-core%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fcore%2Finternal%2FSdkFeature.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZGQtc2RrLWFuZHJvaWQtY29yZS9zcmMvbWFpbi9rb3RsaW4vY29tL2RhdGFkb2cvYW5kcm9pZC9jb3JlL2ludGVybmFsL1Nka0ZlYXR1cmUua3Q=) | `89.10% <100.00%> (+0.07%)` | :arrow_up: | | [...id/core/internal/data/upload/DataUploadRunnable.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/1991?src=pr&el=tree&filepath=dd-sdk-android-core%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fcore%2Finternal%2Fdata%2Fupload%2FDataUploadRunnable.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZGQtc2RrLWFuZHJvaWQtY29yZS9zcmMvbWFpbi9rb3RsaW4vY29tL2RhdGFkb2cvYW5kcm9pZC9jb3JlL2ludGVybmFsL2RhdGEvdXBsb2FkL0RhdGFVcGxvYWRSdW5uYWJsZS5rdA==) | `96.83% <100.00%> (+0.05%)` | :arrow_up: | | [...d/core/internal/data/upload/DataUploadScheduler.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/1991?src=pr&el=tree&filepath=dd-sdk-android-core%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fcore%2Finternal%2Fdata%2Fupload%2FDataUploadScheduler.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZGQtc2RrLWFuZHJvaWQtY29yZS9zcmMvbWFpbi9rb3RsaW4vY29tL2RhdGFkb2cvYW5kcm9pZC9jb3JlL2ludGVybmFsL2RhdGEvdXBsb2FkL0RhdGFVcGxvYWRTY2hlZHVsZXIua3Q=) | `100.00% <100.00%> (ø)` | | ... and [24 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/1991/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)