UploadSchedulerStrategy - DataDog/dd-sdk-android GitHub Wiki

interface UploadSchedulerStrategy

Defines the strategy used to schedule the waiting period between batch uploads.

Functions

getMsDelayUntilNextUpload

abstract fun getMsDelayUntilNextUpload(featureName: String, uploadAttempts: Int, lastStatusCode: Int?, throwable: Throwable?): Long

Should return the delay in milliseconds to wait until the next upload attempt is performed.

Parameters
featureName the name of the feature for which a new upload will be scheduled. Known feature names are listed in the Feature.Companion object.
uploadAttempts the number of requests that were attempted during the last upload batch. Will be zero if the device is not ready (e.g.: when offline or with low battery) or no data is ready to be sent. If multiple batches can be uploaded, the attempts will stop at the first failure.
lastStatusCode the HTTP status code of the last request (if available). A successful upload will have a status code 202 (Accepted). When null, it means that the network request didn't fully complete.
throwable the exception thrown during the upload process (if any).