Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sending empty profiles #2232

Merged
merged 2 commits into from Sep 6, 2022
Merged

Avoid sending empty profiles #2232

merged 2 commits into from Sep 6, 2022

Conversation

stefanosiano
Copy link
Member

📜 Description

Added a check on the sampled profile not to be empty in order to be sent

💡 Motivation and Context

We received few profiles without any content. There is already a check if the profiling trace file doesn't exists or cannot be read, but no check if it is empty. I couldn't be able to reproduce the issue, other than changing the content of the file right before being sent.
However, this should fix it

💚 How did you test it?

I added both a Unit and a Ui test to check empty profiles are discarded

📝 Checklist

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

added unit and ui test to check empty profiles are discarded
profiling sample activity default flag switched
added unit and ui test to check empty profiles are discarded
profiling sample activity default flag switched
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2022

Codecov Report

Base: 80.62% // Head: 80.64% // Increases project coverage by +0.01% 🎉

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2232      +/-   ##
============================================
+ Coverage     80.62%   80.64%   +0.01%     
- Complexity     3357     3358       +1     
============================================
  Files           240      240              
  Lines         12335    12337       +2     
  Branches       1638     1639       +1     
============================================
+ Hits           9945     9949       +4     
+ Misses         1783     1782       -1     
+ Partials        607      606       -1     
Impacted Files Coverage Δ
...ry/src/main/java/io/sentry/SentryEnvelopeItem.java 87.58% <100.00%> (+0.17%) ⬆️
...n/java/io/sentry/transport/ReusableCountLatch.java 94.11% <0.00%> (+5.88%) ⬆️

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.

@stefanosiano stefanosiano marked this pull request as ready for review September 5, 2022 16:11
@stefanosiano stefanosiano merged commit 38e033e into main Sep 6, 2022
@stefanosiano stefanosiano deleted the fix/empty-profiles-sent branch September 6, 2022 07:38
vaind pushed a commit that referenced this pull request Sep 7, 2022
* added a check on the sampled profile not to be empty in order to be sent
* added unit and ui test to check empty profiles are discarded
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.

None yet

3 participants