-
Notifications
You must be signed in to change notification settings - Fork 1
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
Database API: generate printers through reflection #615
Comments
(Currently on branch |
This is a patch of some pending work for |
It could look like /sec is a modifier only used by |
Incompatibility that is not yet fixed: the reflective printer insists on printing boolean values as 0/1 but the old printer sometimes uses no/yes (xnode for config, gpumempct for config + node), other times 0/1 ( |
The profile tests (like the cluster tests, really) will require fixes to both the old and new code, or we kick it down the road: unless processes in a job are completely sorted the profiles will be completely uncomparable. This should happen anyway (#600) and not just for the sake of testing, but for now it's a headache. |
Developing the vocabulary in sonalyze/VOCAB.md |
Note this comment on the patch for future work: Ideally:
At the moment, the relative test cases we run manually are good enough, but are not going to be run forever, so consider moving basic testing in here. |
For #615 - Implement formatting by reflection for most verbs
For #615 - Handle parse output by reflection
For #615 - Documentation and test changes uplifted from jobs branch
This is cleanup I've been working on in the background that's turning out ok, so let's track it: all the "tables" and "reports" exposed by sonalyze have custom, hand-maintained printing code, meaning the code is maintained in several scattered places and it's a bit of a mess to remember how to maintain it when it needs to change. It's possible to use Go's reflection API to instead generate printers from the structure definitions with some annotations; this brings everything together in one place (with the caveat that there can't easily be multiple different printers for the same data). This is not completely free: code that now performs computation as part of printing must be lifted into a separate computation step that computes the result table that is then printed. But the consequence of doing that is a cleaner separation of concerns.
In order not to block the adding of new fields to the sonar output and to avoid merge hell if we do, I want to land what I have asap, and then mop up the remaining cases (jobs and parse) later. To-do:
Then the next step(s):
The text was updated successfully, but these errors were encountered: