Skip to content

Conversation

@juiceblender
Copy link

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!

@b20n
Copy link
Owner

b20n commented Aug 5, 2015

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...

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.

2 participants