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
Fix for wrapper function returning 0ms timings #41
Conversation
DEBUG: Bad line: 0,ms in msg "production.timer:0|ms" https://github.com/etsy/statsd/blob/5b900711191a9c5cfd536c877a3c119d1df5679a/lib/helpers.js#L35 return isNumber(fields[0]) && Number(fields[0]) > 0; statsD expects a > 0 number for ms counters.
That's interesting. I'd actually argue that's an issue with StatsD. Dropping a sub millisecond time that the application submitted changes the measured value. Unless they've specifically rejected changing that it seems like the fix belongs there. |
I know this could spiral down code philosophical hell, but the official statsD implementation does in fact reject 0ms times, as well, its not theoretically possible to run something in less than the unit of time that it measures (which is actually 10ms). I would change it in my code, but I am using the wrapper function, not the .timer() so I cannot apply logic, and is also why I did not change the actual call, only the function. I will fix the tests and rebase. |
I don't understand that, obviously it's possible to run something in less than a millisecond or else you never would have seen this. I'm saying the "official" implementation—which is only a de facto standard—is wrong. If you look at the commit that added the >0 check, it wasn't specifically supposed to do that, just to more liberally validate that the value was actually a number. Since the timers are averaged, dropping 0 values in a client (or the server, really) systematically skews the data.Sent from my phone, please excuse the occasional typo. On Sat, Mar 8, 2014 at 7:16 PM, Alex Corley notifications@github.com
|
I meant the original simply drops them, so this was an attempt to save network i/o, and statsd error handling, but honestly after reading through all the tests, I am tending to lean towards moving this up to statsd with a 'allowZeroTiming' option for those of us who rely on the aggregate timing functions of counting. |
I'm happy to open a pull req upstream as well. I'm sold that they shouldn't drop 0 times-- Sent from my phone, please excuse the occasional typo. On Sat, Mar 8, 2014 at 7:44 PM, Alex Corley notifications@github.com
|
Seems there were a few of us on it, I just started a bit downstream instead of from the source ;) |
Ah, looked at the python-statsd pull req, and the timing floor WoLpH mentioned is actually 10µs, not 10ms (just for myself/posterity). |
One of the more thorough people I've encountered... many thanks for your info as well as guidance... honestly learned more digging through code and this issue than blinding running services for a while. |
* Update docker-compose ports and remove import List and Dict from typing * Add buttons field in AnswerData * Add extensive tests for buttons data validation * Remove TODO * Split too long test in function * Remove useless required_field helper * Add a default_factory list for buttons * Remove useless comment
DEBUG: Bad line: 0,ms in msg "production.timer:0|ms"
https://github.com/etsy/statsd/blob/5b900711191a9c5cfd536c877a3c119d1df5679a/lib/helpers.js#L35
return isNumber(fields[0]) && Number(fields[0]) > 0;
statsD expects a > 0 number for ms counters.