Skip to content

Make 0 sample rate a valid rate#2573

Merged
romtsn merged 5 commits intomainfrom
feat/rz/sample-rate-0-valid
Feb 27, 2023
Merged

Make 0 sample rate a valid rate#2573
romtsn merged 5 commits intomainfrom
feat/rz/sample-rate-0-valid

Conversation

@romtsn
Copy link
Copy Markdown
Member

@romtsn romtsn commented Feb 27, 2023

📜 Description

Allow 0.0 sample rate to be set (though the effect would be as setting sample rate to null).

💡 Motivation and Context

To align with other SDKs (RN, Cocoa, Flutter)

💚 How did you test it?

Automated tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2023

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Make 0 sample rate a valid rate ([#2573](https://github.com/getsentry/sentry-java/pull/2573))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 5494450

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 314.26 ms 378.32 ms 64.06 ms
Size 1.73 MiB 2.34 MiB 626.23 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
db5bd4e 314.82 ms 349.17 ms 34.35 ms
db5bd4e 286.94 ms 315.26 ms 28.32 ms
db5bd4e 347.00 ms 366.74 ms 19.74 ms
db5bd4e 352.90 ms 359.52 ms 6.62 ms

App size

Revision Plain With Sentry Diff
db5bd4e 1.73 MiB 2.34 MiB 626.30 KiB
db5bd4e 1.73 MiB 2.34 MiB 626.30 KiB
db5bd4e 1.73 MiB 2.34 MiB 626.30 KiB
db5bd4e 1.73 MiB 2.34 MiB 626.30 KiB

Previous results on branch: feat/rz/sample-rate-0-valid

Startup times

Revision Plain With Sentry Diff
b0562f1 383.23 ms 440.89 ms 57.66 ms
74491c0 312.64 ms 337.45 ms 24.81 ms

App size

Revision Plain With Sentry Diff
b0562f1 1.73 MiB 2.34 MiB 626.23 KiB
74491c0 1.73 MiB 2.34 MiB 626.23 KiB

Copy link
Copy Markdown
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

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

LGTM! The docs already mention "a value between 0.0 and 1.0", so no need to update anything there.

Copy link
Copy Markdown
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2023

Codecov Report

Base: 80.42% // Head: 80.39% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (fd8c60d) compared to base (db5bd4e).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head fd8c60d differs from pull request most recent head 5494450. Consider uploading reports for the commit 5494450 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2573      +/-   ##
============================================
- Coverage     80.42%   80.39%   -0.04%     
+ Complexity     4011     4004       -7     
============================================
  Files           329      329              
  Lines         15114    15111       -3     
  Branches       1979     1978       -1     
============================================
- Hits          12156    12149       -7     
- Misses         2179     2183       +4     
  Partials        779      779              
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/SentryOptions.java 80.43% <ø> (ø)
.../src/main/java/io/sentry/util/SampleRateUtils.java 87.50% <100.00%> (-3.41%) ⬇️
sentry/src/main/java/io/sentry/HubAdapter.java 6.15% <0.00%> (-3.08%) ⬇️
sentry/src/main/java/io/sentry/Sentry.java 55.02% <0.00%> (-1.06%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@romtsn romtsn enabled auto-merge (squash) February 27, 2023 12:29
@romtsn romtsn merged commit d691d8f into main Feb 27, 2023
@romtsn romtsn deleted the feat/rz/sample-rate-0-valid branch February 27, 2023 12:29
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