hattedsquirrel / ryzen_monitor

Monitor power information of Ryzen processors via the PM table of the SMU
GNU Affero General Public License v3.0
95 stars 16 forks source link

Machine readable output #24

Open jbosboom opened 1 year ago

jbosboom commented 1 year ago

This implements machine-readable JSON and newline-delimited JSON output, as I requested in #15. It creates an output abstraction based on groups that contain data. A datum corresponds to an output line in the standard box-drawing-character-based output, so some contain two or three actual measurements. This is logically unsatisfying, but fusing two or three measurements into one line requires state while splitting one datum into two or three measurements does not.

The only change to the current output is that some voltages are printed with an extra digit after the decimal place.

The abstraction introduced in this pull request could be the basis of a compact output that fits in an 80-column terminal by ditching the box-drawing characters, or for selectively hiding groups or individual lines in the output.