Skip to content

REPLAY-1868 Configure Session Replay uploader to be more eager#1363

Merged
ncreated merged 2 commits into
developfrom
ncreated/REPLAY-1868/make-sr-uploader-more-eager
Jul 7, 2023
Merged

REPLAY-1868 Configure Session Replay uploader to be more eager#1363
ncreated merged 2 commits into
developfrom
ncreated/REPLAY-1868/make-sr-uploader-more-eager

Conversation

@ncreated

@ncreated ncreated commented Jul 6, 2023

Copy link
Copy Markdown
Member

What and why?

📦 This PR tunes the performance of SR uploader, making it more eager. This is to increase reliability of replay uploads.

How?

The PerformancePreset for Session Replay is now overwritten with values that correspond to uploadFrequency: .fast and batchSize: .small setup.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@ncreated
ncreated requested a review from a team as a code owner July 6, 2023 11:39
@ncreated ncreated self-assigned this Jul 6, 2023
if #available(iOS 13.0, tvOS 13.0, *) {
return findONiOS13AndLater()
} else {
assertionFailure("TODO: RUMM-2409 `AppWindowObserver` isn't yet ready for this version of OS")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🧽 This is just cleanup. We don't yet support it below iOS 13.0 - we will add it later.

}()

let uploadDelayFactors: (initial: Double, default: Double, min: Double, max: Double, changeRate: Double) = {
let uploadDelayFactors: (initial: Double, min: Double, max: Double, changeRate: Double) = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

default was unused ✨

@maciejburda maciejburda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

}

func updated(with: PerformancePresetOverride) -> PerformancePreset {
func updated(with override: PerformancePresetOverride) -> PerformancePreset {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice 🙌

Comment on lines +66 to +67
meanFileAge: 5, // equivalent of `batchSize: .small` - see `DatadogCore.PerformancePreset`
minUploadDelay: 1 // equivalent of `uploadFrequency: .frequent` - see `DatadogCore.PerformancePreset`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a little bit ugly. Maybe we could share those enums 🤔

Is it any easier in v2?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In a simple way we can't because it is defined in DatadogCore and SR doesn't depend on that module. It depends on DatadogInternal and moving this enum in there would further break the isolation (it's already partially broken due to PerformancePresetOverride). I think long term we rather won't need overrides and invent something better for this problem.

@maxep what's your take on this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think settings by value enable greater flexibility. If that was exposed to user, then yes enum would have been best but since this is an internal contract between the core and Features, we can use values 👍

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 6, 2023

Copy link
Copy Markdown

Datadog Report

Branch report: ncreated/REPLAY-1868/make-sr-uploader-more-eager
Commit report: 7adf22c

dd-sdk-ios: 0 Failed, 0 New Flaky, 116 Passed, 0 Skipped, 3m 1.38s Wall Time

@maxep maxep left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@ncreated
ncreated merged commit f833251 into develop Jul 7, 2023
@ncreated
ncreated deleted the ncreated/REPLAY-1868/make-sr-uploader-more-eager branch July 7, 2023 09:51
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