-
Notifications
You must be signed in to change notification settings - Fork 816
WIP: Text format parser for Python #54
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
Conversation
I'll have a look ASAP. |
|
||
Custom collectors should use GaugeMetricFamily, CounterMetricFamily | ||
and SummaryMetricFamily instead. | ||
''' | ||
def __init__(self, name, documentation, typ): |
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.
Has nothing to do with the change, but: Why typ
and not type
?
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.
NM, keywords are evil... :-(
Before checking further: Let's confirm what the intention WRT whitespace is. The text format is supposed to have any amount of non-new-line whitespace between tokens.
|
OK, looks sane to me. Just sprinkle a few crazy whitespace characters over the test cases to see if it works. |
The |
Ah, didn't see that... with the pre-squashed commits, it's difficult to see what has changed... 👍 But definitely leave the whitespace flexibility in place. That's what people expect when they see this kind of syntax. Remember that the text format is also meant to be easy for humans to assemble. |
Split out test files. Add missing histogram exposition test. Add unittests for metric families.
Fix exposition of 'NaN' in text format (Python uses 'nan').
WIP: Text format parser for Python
@beorn7 Would you mind taking a peek at this to see if I've missed anything major? Main code is in parser.py, the rest is surrounding changes for this to make sense and have the right data structures.
The motivation is that Zalando's Zmon has a partial implementation of the text parser, so I'd like to offer them an official option.