flux-core icon indicating copy to clipboard operation
flux-core copied to clipboard

add -h flag for no header in flux resource drain for streamlined monitoring

Open Raj-Bagri1 opened this issue 2 years ago • 5 comments

much like sinfo -h if we can add a -h flag to flux so that when running flux resource drain the header does not appear so when running it in a script across all clusters, the header does not continue to output everytime. For example the output would go from this;

TIMESTAMP STATE RANK REASON NODELIST 2022-09-11T09:06:44 drained 15 broker was unresponsive fluke18 2022-08-15T15:57:08 drained 63 broker was unresponsive fluke66

To this;

2022-09-11T09:06:44 drained 15 broker was unresponsive fluke18 2022-08-15T15:57:08 drained 63 broker was unresponsive fluke66

Raj-Bagri1 avatar Oct 11 '22 16:10 Raj-Bagri1

Good idea!

Since -h often used for help, I'd vote we be consistent with flux-jobs(1) which has:

      -n, --suppress-header
              For default output, do not output column headers.

garlick avatar Oct 11 '22 16:10 garlick

I agree being more consistent would be better

Raj-Bagri1 avatar Oct 11 '22 16:10 Raj-Bagri1

while we're at it, should we introduce more things to make flux resource and flux-jobs more alike? (Edit: also taking #4673 in mind here). thoughts that come to mind:

  • named formats
  • extra verbosity turned into --format=long

chu11 avatar Oct 11 '22 17:10 chu11

Good points @chu11. I looked at this as part of #4670, but there are very few available fields for flux resource list|drain so it seemed like a fair bit of code for little benefit. (Note however, this issue is about flux resource drain not flux resource list, which already has a -n, --no-header option)

grondo avatar Oct 11 '22 18:10 grondo

Actually after reading the other issue @chu11, maybe you have a point...

grondo avatar Oct 11 '22 18:10 grondo