[PATCH 2/2] kvm_stat: scale delta column to make it a rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux