Skip to content

Conversation

@louiszawadzki
Copy link
Contributor

What does this PR do?

Add an option to configure the batch size of data uploads

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@louiszawadzki louiszawadzki requested a review from a team as a code owner May 15, 2023 09:28
Copy link
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

lgtm, I've added few suggestions.

}

@Test
fun `𝕄 initialize native SDK 𝕎 initialize() {small batch size}`(
Copy link
Member

Choose a reason for hiding this comment

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

minor: since the size of DdSdkTest file is growing, maybe it is worth to convert some similar tests to ParametrizedTest? So that there is once test with just different inputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was looking for something like this! Thanks a lot I will update some of the tests that will benefit from it :)

Copy link
Member

Choose a reason for hiding this comment

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

We are using them in the Android SDK codebase, you can check there.

public uploadFrequency: UploadFrequency = DEFAULTS.uploadFrequency;

/**
* Sets the preferred size for uploaded batches of data.
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to have a bit more explanation on this parameter, because currently it is not obvious what does it change (yes, size is different, but what is the real impact?).

Android SDK says the following: Defines the batch size (impacts the size and number of requests performed by Datadog)., so at least we can hint the user that number of requests will be different, resulting in the different number of radio invocations (and smaller size has better chances to squeeze for the cost of more radio invocations).

iOS documentation says the following:

Defines the Datadog SDK policy when batching data together before uploading it to Datadog servers.
Smaller batches mean smaller but more network requests, whereas larger batches mean fewer but larger network requests.

@louiszawadzki louiszawadzki requested a review from 0xnm May 15, 2023 11:43
@louiszawadzki louiszawadzki merged commit a801ea1 into develop May 15, 2023
@louiszawadzki louiszawadzki deleted the louiszawadzki/configure-batch-size branch May 15, 2023 12:01
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