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

feat(histogram): add meaningful exception when histograms add buckets with different sizes #1880

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

Boyuan-Yu
Copy link
Contributor

@Boyuan-Yu Boyuan-Yu commented Nov 5, 2024

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?
  • Docs have been added / updated (for bug fixes / features) ?

Current behavior : when histograms add buckets with different sizes, it returns a 5xx error

New behavior : it returns an IllegalArgumentException with a meaningful message

@Boyuan-Yu Boyuan-Yu marked this pull request as ready for review November 5, 2024 22:14
@Boyuan-Yu Boyuan-Yu marked this pull request as draft November 5, 2024 22:17
@Boyuan-Yu Boyuan-Yu marked this pull request as ready for review November 5, 2024 22:57
@sandeep6189
Copy link
Contributor

Please follow the guidelines for PR descriptions ( look at the previous closed PRs for reference as well)

@Boyuan-Yu Boyuan-Yu changed the title Add meaningful exception when histograms adding buckets with different sizes feat(histogram): add meaningful exception when histograms add buckets with different sizes Nov 6, 2024
@Boyuan-Yu
Copy link
Contributor Author

Please follow the guidelines for PR descriptions ( look at the previous closed PRs for reference as well)

Thanks for the reminder. It's updated.

Copy link
Contributor

@yu-shipit yu-shipit left a comment

Choose a reason for hiding this comment

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

lgtm

@yu-shipit yu-shipit merged commit be75fb4 into filodb:develop Nov 12, 2024
1 check passed
assert(other.buckets == buckets)
if (other.buckets != buckets) {
throw new IllegalArgumentException(
"Mismatch in bucket sizes. Cannot add histograms with different bucket configurations."
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: buckets size could also be same, but the bucket configurations might be different

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.

3 participants