Re: pmrep: add support for swapping columns and rows in stdout output
"Mark Goodwin" <[email protected]>
| Newsgroups | gmane.comp.sysutils.pcp |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Nov 8, 2016 at 12:04 AM, Marko Myllynen <[email protected]> wrote: > On 2016-11-04 18:14, Marko Myllynen wrote: > > On 2016-11-03 03:05, Mark Goodwin wrote: > >> > >> I love it! Testing it out, could we consider adding an argument to the > >> -X flag to label the instance name column, and maybe some way to specify > >> it's width (independently of the width for the data columns)? > > > > Yeah, I noticed that it felt a bit of compromise to use the timestamp > > width as the default width, perhaps indeed we could add some sort of > > method to specify width for that, either a separate "field" or something > > like disk.dev.util,'%util',,,6:10, what do you think? > > Hmm, specifying this on per-metric basis of course doesn't make much > sense, not sure what I was thinking. Perhaps we could have -X to take an > argument which could be < 0 turn turn this feature off (the default), 0 > use timestamp width, and > 0 to explicitly specify the width for the > instance column. > yes that would work, or perhaps a quoted string argument could determine the column width, and also provide a heading for the instance column. e.g. -X " Device Name" (one problem with dm devices is they tend to be very long (especially docker / thin-pool LVs). > What do you think? Ok, defining something to 0 to enable it is not the > most intuitive way but I'd like to avoid a separate configuration knob > for the instance width, if possible. > yeah, we're getting into option overload territory a bit > > >> Also, when metrics with different instance domains are specified, maybe > >> we could have a 'filler' such as '-' or '.' or something for the columns > >> which don't make sense on the line for each instance. This would make it > >> easier to parse and post-process because we'd have a fixed number of > >> columns to pick out in the report. > > > > Would setting the column delimiter help, e.g., "pmrep -l : ..."? But > > yes, printing "-" or such wouldn't be unreasonable either. > > Testing this with "-" I think it's aesthetically ok to be used as the > default and not even worth a separate config option (so probably will > add a constant and use it). yep sounds good. Maybe not '-' since it's a valid numerical prefix (unary negation). And "." would have the same problem. I guess ':' or '_' might be OK? BTW the existing column separator option is also OK, e.g. pmrep -l: ... | awk -F: .... Thanks, let's get this merged asap :) CHeers