kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve kvm_stat delta display
@ 2010-09-01  7:05 Avi Kivity
  2010-09-01  7:05 ` [PATCH 1/2] kvm_stat: make the initial sleep shorter Avi Kivity
  2010-09-01  7:05 ` [PATCH 2/2] kvm_stat: scale delta column to make it a rate Avi Kivity
  0 siblings, 2 replies; 3+ messages in thread
From: Avi Kivity @ 2010-09-01  7:05 UTC (permalink / raw)
  To: Marcelo Tosatti, kvm

Make the first sleep shorter, so numbers come up quicker, and scale the
delta so it is a rate-of-change instead of a meaningless number.

Avi Kivity (2):
  kvm_stat: make the initial sleep shorter
  kvm_stat: scale delta column to make it a rate

 kvm/kvm_stat |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] kvm_stat: make the initial sleep shorter
  2010-09-01  7:05 [PATCH 0/2] Improve kvm_stat delta display Avi Kivity
@ 2010-09-01  7:05 ` Avi Kivity
  2010-09-01  7:05 ` [PATCH 2/2] kvm_stat: scale delta column to make it a rate Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-09-01  7:05 UTC (permalink / raw)
  To: Marcelo Tosatti, kvm

So we can see results faster

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 kvm/kvm_stat |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kvm/kvm_stat b/kvm/kvm_stat
index e68ca4e..b031d48 100755
--- a/kvm/kvm_stat
+++ b/kvm/kvm_stat
@@ -325,9 +325,11 @@ def tui(screen, stats):
             row += 1
         screen.refresh()
 
+    sleeptime = 0.25
     while True:
         refresh()
-        curses.halfdelay(30)
+        curses.halfdelay(int(sleeptime * 10))
+        sleeptime = 3
         try:
             c = screen.getkey()
             if c == 'q':
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] kvm_stat: scale delta column to make it a rate
  2010-09-01  7:05 [PATCH 0/2] Improve kvm_stat delta display Avi Kivity
  2010-09-01  7:05 ` [PATCH 1/2] kvm_stat: make the initial sleep shorter Avi Kivity
@ 2010-09-01  7:05 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-09-01  7:05 UTC (permalink / raw)
  To: Marcelo Tosatti, kvm

Scale the delta column by 1/sleeptime, so its units are
events per second.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 kvm/kvm_stat |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kvm/kvm_stat b/kvm/kvm_stat
index b031d48..e32df14 100755
--- a/kvm/kvm_stat
+++ b/kvm/kvm_stat
@@ -301,7 +301,7 @@ number_width = 10
 def tui(screen, stats):
     curses.use_default_colors()
     curses.noecho()
-    def refresh():
+    def refresh(sleeptime):
         screen.erase()
         screen.addstr(0, 0, 'kvm statistics')
         row = 2
@@ -321,13 +321,13 @@ def tui(screen, stats):
             screen.addstr(row, col, '%10d' % (values[0],))
             col += number_width
             if values[1] is not None:
-                screen.addstr(row, col, '%8d' % (values[1],))
+                screen.addstr(row, col, '%8d' % (values[1] / sleeptime,))
             row += 1
         screen.refresh()
 
     sleeptime = 0.25
     while True:
-        refresh()
+        refresh(sleeptime)
         curses.halfdelay(int(sleeptime * 10))
         sleeptime = 3
         try:
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-01  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01  7:05 [PATCH 0/2] Improve kvm_stat delta display Avi Kivity
2010-09-01  7:05 ` [PATCH 1/2] kvm_stat: make the initial sleep shorter Avi Kivity
2010-09-01  7:05 ` [PATCH 2/2] kvm_stat: scale delta column to make it a rate Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).