DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
150 stars 59 forks source link

RUM-1662: Create SessionEndedMetric and SessionEndedMetricDispatcher with unit test #2083

Closed ambushwork closed 3 months ago

ambushwork commented 3 months ago

What does this PR do?

Motivation

Ticket: https://datadoghq.atlassian.net/browse/RUM-1662

Additional Notes

This is the first step of this task, only implementation of two classes with unit test assuring that the data structure and json format matches the specification. In next PR, these two classes will be used inside RumSessionScope or RumApplicatioScope to track the session.

Review checklist (to be filled by reviewers)

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 86.84211% with 10 lines in your changes missing coverage. Please review.

Project coverage is 68.44%. Comparing base (5197289) to head (f469d0a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## feature/session-ended-metric #2083 +/- ## ================================================================ - Coverage 68.73% 68.44% -0.29% ================================================================ Files 719 721 +2 Lines 26571 26623 +52 Branches 4472 4482 +10 ================================================================ - Hits 18262 18221 -41 - Misses 7123 7188 +65 - Partials 1186 1214 +28 ``` | [Files](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2083?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [.../android/rum/internal/metric/SessionEndedMetric.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2083?src=pr&el=tree&filepath=features%2Fdd-sdk-android-rum%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Frum%2Finternal%2Fmetric%2FSessionEndedMetric.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtcnVtL3NyYy9tYWluL2tvdGxpbi9jb20vZGF0YWRvZy9hbmRyb2lkL3J1bS9pbnRlcm5hbC9tZXRyaWMvU2Vzc2lvbkVuZGVkTWV0cmljLmt0) | `92.59% <92.59%> (ø)` | | | [...um/internal/metric/SessionEndedMetricDispatcher.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2083?src=pr&el=tree&filepath=features%2Fdd-sdk-android-rum%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Frum%2Finternal%2Fmetric%2FSessionEndedMetricDispatcher.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZmVhdHVyZXMvZGQtc2RrLWFuZHJvaWQtcnVtL3NyYy9tYWluL2tvdGxpbi9jb20vZGF0YWRvZy9hbmRyb2lkL3J1bS9pbnRlcm5hbC9tZXRyaWMvU2Vzc2lvbkVuZGVkTWV0cmljRGlzcGF0Y2hlci5rdA==) | `72.73% <72.73%> (ø)` | | ... and [25 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2083/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)
ambushwork commented 3 months ago

@0xnm indeed I forgot to push the commit, now it should be good