Skip to content

RUM-952 Provide the inBackground property for batch_delete metric#1588

Merged
mariusc83 merged 1 commit into
developfrom
mconstantin/rum-952/provide-batch-delete-in-background-property
Aug 25, 2023
Merged

RUM-952 Provide the inBackground property for batch_delete metric#1588
mariusc83 merged 1 commit into
developfrom
mconstantin/rum-952/provide-batch-delete-in-background-property

Conversation

@mariusc83

Copy link
Copy Markdown
Member

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • 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)

@mariusc83 mariusc83 self-assigned this Aug 25, 2023
@mariusc83
mariusc83 requested a review from a team as a code owner August 25, 2023 08:31
coreFeature.timeProvider
).apply {
if (context is Application) {
context.registerActivityLifecycleCallbacks(

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.

should we try to unregister this on stop ? Are we worried about leaks ?

0xnm
0xnm previously approved these changes Aug 25, 2023
Comment on lines +172 to +189
BatchMetricsDispatcher(
wrappedFeature.name,
dataUploadConfiguration,
filePersistenceConfig,
internalLogger,
coreFeature.timeProvider
).apply {
if (context is Application) {
context.registerActivityLifecycleCallbacks(
ProcessLifecycleMonitor(this)
)
}
metricsDispatcher = 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.

apply already returns the instance.

Suggested change
BatchMetricsDispatcher(
wrappedFeature.name,
dataUploadConfiguration,
filePersistenceConfig,
internalLogger,
coreFeature.timeProvider
).apply {
if (context is Application) {
context.registerActivityLifecycleCallbacks(
ProcessLifecycleMonitor(this)
)
}
metricsDispatcher = this
}
metricsDispatcher = BatchMetricsDispatcher(
wrappedFeature.name,
dataUploadConfiguration,
filePersistenceConfig,
internalLogger,
coreFeature.timeProvider
).apply {
if (context is Application) {
context.registerActivityLifecycleCallbacks(
ProcessLifecycleMonitor(this)
)
}
}

import java.util.concurrent.atomic.AtomicInteger

internal class ProcessLifecycleMonitor(val callback: Callback) :
internal class ProcessLifecycleMonitor(internal val callback: Callback) :

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.

in theory this change is not needed, because the class itself is already internal.

@mariusc83
mariusc83 force-pushed the mconstantin/rum-952/provide-batch-delete-in-background-property branch 2 times, most recently from c45a5d5 to 1ceb35d Compare August 25, 2023 08:49
@mariusc83
mariusc83 requested a review from 0xnm August 25, 2023 08:55
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #1588 (1ceb35d) into develop (199513c) will increase coverage by 0.04%.
Report is 2 commits behind head on develop.
The diff coverage is 90.91%.

@@             Coverage Diff             @@
##           develop    #1588      +/-   ##
===========================================
+ Coverage    83.56%   83.60%   +0.04%     
===========================================
  Files          443      443              
  Lines        15100    15114      +14     
  Branches      2258     2261       +3     
===========================================
+ Hits         12618    12636      +18     
+ Misses        1883     1875       -8     
- Partials       599      603       +4     
Files Changed Coverage Δ
...in/com/datadog/android/core/internal/SdkFeature.kt 88.98% <88.89%> (-0.68%) ⬇️
...id/core/internal/metrics/BatchMetricsDispatcher.kt 96.61% <100.00%> (+0.18%) ⬆️

... and 20 files with indirect coverage changes

@mariusc83
mariusc83 force-pushed the mconstantin/rum-952/provide-batch-delete-in-background-property branch from 1ceb35d to 231e837 Compare August 25, 2023 11:17
@mariusc83
mariusc83 merged commit 93bd009 into develop Aug 25, 2023
@mariusc83
mariusc83 deleted the mconstantin/rum-952/provide-batch-delete-in-background-property branch August 25, 2023 11:49
@xgouchet xgouchet added this to the 2.1.0 milestone Dec 13, 2023
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.

4 participants