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

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

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Jul 6, 2023

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
@@ -17,7 +17,6 @@ internal class KeyWindowObserver: AppWindowObserver {
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
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
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 ✨

Copy link
Member

@maciejburda maciejburda left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -126,19 +124,19 @@ internal extension PerformancePreset {
self.uploadDelayChangeRate = uploadDelayFactors.changeRate
}

func updated(with: PerformancePresetOverride) -> PerformancePreset {
func updated(with override: PerformancePresetOverride) -> PerformancePreset {
Copy link
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
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
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
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
Copy link

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

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

Copy link
Member

@maxep maxep left a comment

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