sensu / sensu-go

Simple. Scalable. Multi-cloud monitoring.
https://sensu.io
MIT License
1.01k stars 177 forks source link

Add output streaming support to sensuctl #4238

Open echlebek opened 3 years ago

echlebek commented 3 years ago

Expected Behavior

When listing resources with sensuctl and using the --chunk-size option, I expect to receive each chunk as it arrives.

Current Behavior

The chunks are collated until there are no more chunks to bad had, before being output.

Possible Solution

Add output streaming support to sensuctl. This will necessitate rewriting much of the output formatting code, which is due for an overhaul in any case.

Steps to Reproduce (for bugs)

  1. Try to output tens of thousands of resources with a small chunk size. (i.e. sensuctl event list --chunk-size 100)
  2. Observe that the operation takes a long time to return any information.
ccressent commented 3 years ago

Some context: https://github.com/sensu/sensu-go/pull/2966

calebhailey commented 3 years ago

One of the comments in #2966 that caught my attention was RE: tabular output column widths, which is something I'd love to revisit. The way we render columns in certain sensuctl outputs today is quite cumbersome because we don't place any limits on the output (e.g. if an event has a very long output the columnar output of sensuctl event list is a mess). I'd love to see us adopt some sort of truncation, if not completely revisit the design of columnar list output.