Skip to content
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

Make incus top output configurable through options #1028

Open
stgraber opened this issue Jul 20, 2024 · 4 comments
Open

Make incus top output configurable through options #1028

stgraber opened this issue Jul 20, 2024 · 4 comments
Assignees
Labels
Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@stgraber
Copy link
Member

Splitting that one off of #1026

Currently incus top can only be configured through shortcuts.

It'd be good to have it support our standard --format and --columnsoptions as well as a--refresh` to configure the refresh delay.

@stgraber stgraber added Feature New feature, not a bug Easy Good for new contributors labels Jul 20, 2024
@stgraber stgraber added this to the soon milestone Jul 20, 2024
@Eglantinee
Copy link

Hi @stgraber,
I am new to open source and would like to take my first steps by working on this issue.
Can you assign this issue to me?
TIA.

@stgraber
Copy link
Member Author

Done!

@Eglantinee
Copy link

Eglantinee commented Jul 29, 2024

@stgraber
I have a question from the beginning: please clarify several things about the new keys:

  • refresh - Should this be an int flag or time.Duration?
  • columns - I assume this is a list of columns to be shown from the possible ones. Am I right? BTW, do you want to support some ordering for the columns?
  • format - I can only guess what this is (format for output values in the columns?). Can you please provide me with an example, or if it is some standard behavior, where it is used, so I can use it as a reference?

TIA.

@stgraber
Copy link
Member Author

stgraber commented Aug 1, 2024

flagRefresh should be an int with a default value of 10.
flagColumns should be similar to what we do in commands like incus list though at the beginning we'd just stick with the set of columns we have right now but make it possible show/hide them and indeed to re-order them.
flagFormat should behave like our other list commands with the exception that for incus top, we'd likely just allow table and compact as the other formats (csv, json and yaml) don't make as much sense for an interactive tool.

So basically we should be able to do:
incus top --refresh=30 --all-projects --columns=enDum --format=compact and get a live updated table that looks like:

  PROJECT  NAME          DISK        CPU        MEMORY
  default  incus-ui      1.27GiB     20s        80.78MiB      
  default  kernel-test   5.12GiB     186s       1.17GiB       
  default  ovn           2.94GiB     418s       1.35GiB       
  default  speedtest     294.01MiB   21s        90.04MiB      
  vpn      vpn-foo       153.17MiB   32s        48.89MiB      
  vpn      vpn-bar       960.43MiB   1481s      1.67GiB       
  vpn      vpn-baz       101.76MiB   18s        37.25MiB      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Good for new contributors Feature New feature, not a bug
Development

No branches or pull requests

2 participants