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

Handle empty metrics after 10 min #219

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

gastonfournier
Copy link
Contributor

About the changes

This PR adds a test to validate what happens when metrics are empty for more than 10 minutes. This other PR #218 tested that it was actually failing.

We've also validated that nil bucket returns a 400 from Unleash server side so instead we should always fallback to an empty bucket.

@@ -534,15 +534,15 @@ end
## Development

After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake spec` to run the tests.
Then, run `bundle exec rake spec` to run the tests.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least in my machine I needed to add exec and other places in this readme also uses exec so I think this is the safest

@coveralls
Copy link

coveralls commented Dec 10, 2024

Pull Request Test Coverage Report for Build 12263142735

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 95.374%

Totals Coverage Status
Change from base Build 11949559077: -0.01%
Covered Lines: 433
Relevant Lines: 454

💛 - Coveralls

@gastonfournier gastonfournier self-assigned this Dec 10, 2024
platformVersion: anything,
bucket: {}
)
)
Copy link
Member

Choose a reason for hiding this comment

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

Is this working as expected? I thought the intention would be not to post to server when it's empty.

Copy link
Member

Choose a reason for hiding this comment

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

Nvm, we're subtracting by 10 minutes and 1 second, which means that the second part of our condition is not met, so we post the empty metrics. Got it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, turns out this code path was apparently not tested and didn't work as expected. Although it's an edge case I think it makes sense

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LGTM

@gastonfournier gastonfournier merged commit 07c10ef into main Dec 19, 2024
28 of 31 checks passed
@gastonfournier gastonfournier deleted the handle-empty-metrics-after-10-min branch December 19, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants