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

Allow customizing handling of out-of-range counts when serializing #41

Open
marshallpierce opened this issue Mar 16, 2017 · 2 comments
Open

Comments

@marshallpierce
Copy link
Collaborator

We allow u64 counts, but the serialization format only allows i64::max_value() as the largest count. So, you can end up with an un-serializable histogram.

It would be nice if the user could choose what to do in such a situation. Right now we always error, which means I needed to do things like https://github.com/jonhoo/hdrsample/pull/40/files#diff-c761d465047faa0efb455f492b2f1e07R528 when testing serialization with random counts.

Options that come to mind:

  • Error (we've got this one now)
  • Squish oversized counts down to i64::max_value()
  • ???
@marshallpierce
Copy link
Collaborator Author

@jonhoo
Copy link
Collaborator

jonhoo commented Mar 16, 2017

One alternative here is that we make Counter an enum, where the variants are u8, u16, u32, and u63...

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

No branches or pull requests

2 participants