-
Notifications
You must be signed in to change notification settings - Fork 921
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
Feature request: convert ws-auth to produce numerical stats. #4915
Conversation
Run tests for ws/api:
Ensure you have python + virtualenv installed first. |
Atm ws-recursor has very important code commented out to make this compile.
ebc0a83
to
4170fc6
Compare
|
Still working through this. First go at recursor, but it's a little more intensive & I have less knowledge of the project right now which will slow down some of my manual testing some. I'm not sure whether "unsigned long" or uint64_t is preferred? The latter is just a typedef, no? I see some of each in different points in the codebase. |
@@ -63,7 +63,7 @@ private: | |||
static bool s_init; | |||
}; | |||
|
|||
std::map<std::string, std::string> getAllStatsMap(); | |||
std::map<std::string, int> getAllStatsMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mismatched type between decl here and impl below.
|
Had momentarily just been 'int' in this conversion, had failed to update this one usage.
Many JSON implementations limit integers to 53 bits; is this a concern? |
Right, I think we're limited to |
@zeha exactly, which does lossless integers up to something around 53 bits (signed, I think) |
JSON the spec has no limit. Unfortunately as per dropbox/json11#16 the JSON library we use insists that round-tripping a number through JSON in JS has higher precedence for their implementation than the spec, and refuses to offer any means to use large integers (tagged above issue wontfix). So yes, metrics are- just before conversion to json- cast to double. Yes, numbers get imprecise after 53 bits, not counting the sign bit, as Habbie says. |
@aerique I believe you were working on similar things with dnsdist, can you chime in? |
Yes, we 'fixed' it for dnsdist by casting to double as well. 53 bits should be enough for everyone. See: #5234 |
@rektide mind rebasing this? |
ping? |
Closing for lack of response. We'll do a Prometheus endpoint in 4.3 or 4.4 |
Short description
Currently stats are produced as strings, even though they are numbers. This makes them very hard to consume from metrics systems (we're using New Relic Insights at work).
Checklist
I have: