valine icon indicating copy to clipboard operation
valine copied to clipboard

implement virt-top somehow...?

Open ryran opened this issue 8 years ago • 5 comments

I literally forgot about virt-top ... haven't touched it in a couple years. It's too awesome not to use.

ryran avatar Feb 22 '16 15:02 ryran

Yes. +100.

On Mon, Feb 22, 2016, 10:48 Ryan Sawhill Aroha [email protected] wrote:

I literally forgot about virt-top ... haven't touched it in a couple years. It's too awesome not to use.

— Reply to this email directly or view it on GitHub https://github.com/ryran/valine/issues/22.

Aftermath avatar Feb 22 '16 16:02 Aftermath

Yes. +100.

Okay Craig now that you've +100'd you need to offer something. Obviously virt-top can look at multiple different things ... What are you interested in? What would you want to see?

ryran avatar Feb 23 '16 04:02 ryran

My favorite data to pull from virt-top has always been what the memory usage on the vm is (percentage anyway, as I generally know the max already) and which vNIC is associated with which vm, on the fly with the '-2' switch.

The only problem I foresee with grabbing output from virt-top is a slow response on valine's side, which you already know is a thing when you have a boatload of vms to report back.

If I were going to choose just a standard bit of data, it would be a quick snapshot of % memory in use for the vm.

Quickest way I know to get virt-top response is to press space, this forces an update. But obviously capturing the user interface would not be efficient. There are some options to call from script or output to csv, I suppose.

I dunno. You brought it up, what about virt-top interested you for the purposes of valine?

Aftermath avatar Feb 23 '16 04:02 Aftermath

Yeah it sucks that the first update is always blank ... but at least you can do fractions of a second

$ virt-top -n 2 -d .1 --stream
virt-top time  12:55:39 Host jiop.usersys.redhat.com x86_64 8/8CPU 3700MHz 15963MB 
   ID S RDRQ WRRQ RXBY TXBY %CPU %MEM   TIME    NAME
   16 R    0    0    0    0  0.0  0.0   9:00.02 r67
   18 R    0    0    0    0  0.0  0.0 305:20.71 r511
   22 R    0    0    0    0  0.0  0.0   3:08.01 r72
   23 R    0    0    0    0  0.0  0.0   4:29.24 tae66
   24 R    0    0    0    0  0.0  0.0   0:54.88 tae72
virt-top time  12:55:39 Host jiop.usersys.redhat.com x86_64 8/8CPU 3700MHz 15963MB 
   ID S RDRQ WRRQ RXBY TXBY %CPU %MEM   TIME    NAME
   16 R    0    0    0    0 25.8 12.0   9:00.26 r67
   18 R    0    0    0    0  0.0  3.0 305:20.71 r511
   22 R    0    0    0    0 12.9  3.0   3:08.13 r72
   23 R    0    0    0    0  0.0  6.0   4:29.24 tae66
   24 R    0    0    0    0  0.0  6.0   0:54.88 tae72

which vNIC is associated with which vm, on the fly with the '-2' switch.

What do you care about that ^^ for?

I think the only thing I can imagine adding to valine is %cpu, %mem, and time. So maybe I'll do:

$ virt-top -n 2 -d .1 --stream | sed '/^virt-top/,/^virt-top/d' | awk 'NR>1 {printf "%s=(%s %s %s)\n", $NF, $7, $8, $9}'
r67=(24.8 12.0 12:51.74)
r511=(1.1 3.0 305:37.65)
r72=(12.9 3.0 5:03.82)
tae66=(1.1 6.0 4:29.56)
tae72=(0.0 6.0 0:54.94)

Then I can check for those arrays when printing the columns.

ryran avatar Feb 23 '16 17:02 ryran

I used to use that to know what IPs were associated, but now I have things setup much differently. I like your idea here, just CPU/MEM/TIME.

Aftermath avatar Feb 24 '16 02:02 Aftermath