]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: format percent strings of nodecpustats
authorAlex Jia <ajia@redhat.com>
Tue, 26 Jul 2011 07:32:37 +0000 (15:32 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 26 Jul 2011 15:57:36 +0000 (09:57 -0600)
* tools/virsh.c: format strings display for virsh nodecpustats --percent.

* how to reproduce?

% virsh nodecpustats --percent
usage:            2.0%
    user  :       1.0%
    system:       1.0%
idle  :          98.0%
iowait:           0.0%

* after format strings

% virsh nodecpustats --percent
usage:            2.0%
user:             1.0%
system:           1.0%
idle:            98.0%
iowait:           0.0%

Signed-off-by: Alex Jia <ajia@redhat.com>
tools/virsh.c

index f2fd9e550dcea3cbd034d48b9acc9d2298b9c1bd..113124ff52571693b1e0ca35984a86e65d91bc20 100644 (file)
@@ -4438,9 +4438,9 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd)
 
     if (!flag_percent) {
         if (!flag_utilization) {
-            vshPrint(ctl, "%-15s %20llu\n", _("user  :"), cpu_stats[0].user);
+            vshPrint(ctl, "%-15s %20llu\n", _("user:"), cpu_stats[0].user);
             vshPrint(ctl, "%-15s %20llu\n", _("system:"), cpu_stats[0].sys);
-            vshPrint(ctl, "%-15s %20llu\n", _("idle  :"), cpu_stats[0].idle);
+            vshPrint(ctl, "%-15s %20llu\n", _("idle:"), cpu_stats[0].idle);
             vshPrint(ctl, "%-15s %20llu\n", _("iowait:"), cpu_stats[0].iowait);
         }
     } else {
@@ -4448,7 +4448,7 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd)
             usage = cpu_stats[0].util;
 
             vshPrint(ctl, "%-15s %5.1lf%%\n", _("usage:"), usage);
-            vshPrint(ctl, "%-15s %5.1lf%%\n", _("idle :"), 100 - usage);
+            vshPrint(ctl, "%-15s %5.1lf%%\n", _("idle:"), 100 - usage);
         } else {
             user_time   = cpu_stats[1].user   - cpu_stats[0].user;
             sys_time    = cpu_stats[1].sys    - cpu_stats[0].sys;
@@ -4461,11 +4461,11 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd)
             vshPrint(ctl, "%-15s %5.1lf%%\n",
                      _("usage:"), usage);
             vshPrint(ctl, "%-15s %5.1lf%%\n",
-                     _("    user  :"), user_time / total_time * 100);
+                     _("user:"), user_time / total_time * 100);
             vshPrint(ctl, "%-15s %5.1lf%%\n",
-                     _("    system:"), sys_time  / total_time * 100);
+                     _("system:"), sys_time  / total_time * 100);
             vshPrint(ctl, "%-15s %5.1lf%%\n",
-                     _("idle  :"), idle_time     / total_time * 100);
+                     _("idle:"), idle_time     / total_time * 100);
             vshPrint(ctl, "%-15s %5.1lf%%\n",
                      _("iowait:"), iowait_time   / total_time * 100);
         }