Changed metrics to use double for protobuff message #23
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!