Changed metrics to use double for protobuff message#23
Open
juiceblender wants to merge 1 commit intob20n:masterfrom
Open
Changed metrics to use double for protobuff message#23juiceblender wants to merge 1 commit intob20n:masterfrom
juiceblender wants to merge 1 commit intob20n:masterfrom
Conversation
Owner
|
Looks like we should be a bit more clever, even: https://aphyr.com/posts/260-riemann-longs-and-doubles I'll be +1 to merge if you make this a bit closer to that. It sure would be nice to have integers, too, though... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello Benjamin,
I thought treating the metric as a double in the protobuff message would be better because then we would not be susceptible to large metrics losing precision when sent to Riemann. For example, this is an example from my Clojure REPL:
user=> (double 6928568577)
6.928568577E9
user=> (float 6928568577)
6.9285688E9
And it bit me because while doing my calculations, the original number was converted to a float in Clojure and lost precision, which resulted in me running into many problems while trying to write a unit test. I think float is only good up to 7 decimals (https://en.wikipedia.org/wiki/Single-precision_floating-point_format) so while it takes up more space, it's better to use double.
I am by no means proficient in Clojure or Riemann or ProtocolBuffers, but I thought I'll let you know about this. Thanks!