lexmag / statix

Fast and reliable Elixir client for StatsD-compatible servers
https://hexdocs.pm/statix
ISC License
275 stars 82 forks source link

Sample rates precision problem #53

Open shouya opened 4 years ago

shouya commented 4 years ago

Hi I found this issue where having a sample rate of 0.001 will turns out equivalent to sending sample rate as 0.0. It was caused by the following segment of code:

https://github.com/lexmag/statix/blob/00c9d690f41847cab8ad5e70f28e501f98035797/lib/statix/packet.ex#L53

There is no way to circumvent this limit from the user side. Should we perhaps raise the number of digits preserved?