Skip to content

Filter out app starts with more than 60s#2127

Merged
marandaneto merged 11 commits into
mainfrom
fix/filter-appstart-60s
Jun 24, 2022
Merged

Filter out app starts with more than 60s#2127
marandaneto merged 11 commits into
mainfrom
fix/filter-appstart-60s

Conversation

@marandaneto

@marandaneto marandaneto commented Jun 22, 2022

Copy link
Copy Markdown
Contributor

📜 Description

Filter out app starts with more than 60s

💡 Motivation and Context

getsentry/sentry-react-native#2295

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@bruno-garcia

Copy link
Copy Markdown
Member

Oh cocoa the cutoff was 5 min. Is one value more likely to be legit than the other?

@marandaneto

Copy link
Copy Markdown
Contributor Author

Oh cocoa the cutoff was 5 min. Is one value more likely to be legit than the other?

No, Also 60s getsentry/sentry-cocoa#1899

@adinauer adinauer 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.

Only some nits, LGTM!

Comment thread sentry-android-core/src/main/java/io/sentry/android/core/AppStartState.java Outdated
Comment thread sentry-android-core/src/main/java/io/sentry/android/core/AppStartState.java Outdated
Comment thread sentry-android-core/src/main/java/io/sentry/android/core/AppStartState.java Outdated

@philipphofmann philipphofmann 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 🚀

Comment thread sentry-android-core/src/test/java/io/sentry/android/core/AppStartStateTest.kt Outdated
}

@Test
fun `getAppStartInterval returns null if more than 60s`() {

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.

m: We could add another test with the max app start duration of 59999 ms to validate it is working correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is unnecessary, we already test above and lower the boundary.
The comparison is a simple >= with a long value rather than some more complicated calculation.
I can do it but sounds like not needed, your call.

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.

If someone changes the MAX_APP_START_MILLIS to 10000000, no test will fail. Up to you.

@codecov-commenter

codecov-commenter commented Jun 23, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2127 (6dd2eab) into main (b5ef9c5) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #2127   +/-   ##
=========================================
  Coverage     80.93%   80.93%           
  Complexity     3254     3254           
=========================================
  Files           231      231           
  Lines         11951    11951           
  Branches       1586     1586           
=========================================
  Hits           9673     9673           
  Misses         1698     1698           
  Partials        580      580           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5ef9c5...6dd2eab. Read the comment docs.

Comment thread sentry-android-core/src/main/java/io/sentry/android/core/AppStartState.java Outdated

@philipphofmann philipphofmann 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 🚀

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.

5 participants