immediately after starting vmtop, we would output metrics without waiting the refresh period. It wasn't a big issue with the default refresh rate of 1s, but for anything longer it was misleading to output 1 report immediately and then wait the appropriate duration.
if the user wanted to exit with ctrl-c, we were waiting for a full refresh period to actually exit. Again, barely noticeable with a refresh of 1s, but anything longer was annoying.
This commit fixes both issues by making the tool wait for a full refresh period before its first output, and by checking the "stop" flag while waiting for the next refresh output.
There were 2 bugs:
This commit fixes both issues by making the tool wait for a full refresh period before its first output, and by checking the "stop" flag while waiting for the next refresh output.
Signed-off-by: Julien Desfossez jdesfossez@digitalocean.com