[Kimchi-devel] [PATCH] Add support for displaying guest memory utilization

Socorro Stoppler socorro at linux.vnet.ibm.com
Tue Nov 3 16:57:20 UTC 2015


Signed-off-by: Socorro Stoppler <socorro at linux.vnet.ibm.com>
---
 src/wok/plugins/kimchi/ui/css/theme-default/list.css  | 10 +++++++---
 src/wok/plugins/kimchi/ui/js/src/kimchi.guest_main.js |  3 +++
 src/wok/plugins/kimchi/ui/pages/guest.html.tmpl       |  3 +++
 src/wok/plugins/kimchi/ui/pages/guests.html.tmpl      |  1 +
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/wok/plugins/kimchi/ui/css/theme-default/list.css b/src/wok/plugins/kimchi/ui/css/theme-default/list.css
index 8c78623..a705e0d 100644
--- a/src/wok/plugins/kimchi/ui/css/theme-default/list.css
+++ b/src/wok/plugins/kimchi/ui/css/theme-default/list.css
@@ -139,15 +139,19 @@
 }
 
 .guest-cpu {
-    width: 91px;
+    width: 75px;
+}
+
+.guest-memory {
+    width: 75px;
 }
 
 .guest-network {
-    width: 91px;
+    width: 95px;
 }
 
 .guest-storage {
-    width: 91px;
+    width: 65px;
 }
 
 .guest-tile {
diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_main.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_main.js
index 7dd5d84..a6e6fd1 100644
--- a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_main.js
+++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_main.js
@@ -28,6 +28,7 @@ kimchi.sampleGuestObject = {
         "net_throughput": 0,
         "io_throughput_peak": 100,
         "cpu_utilization": 0,
+        "mem_utilization": 0,
         "io_throughput": 0,
         "net_throughput_peak": 100
     },
@@ -372,6 +373,8 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
     kimchi.circleGaugeInit(result, "io_throughput",gaugeValue,(gaugeValue*100/stats.io_throughput_peak));
     gaugeValue=parseInt(stats.cpu_utilization);
     kimchi.circleGaugeInit(result, "cpu_utilization",gaugeValue+"%",gaugeValue);
+    gaugeValue=parseInt(stats.mem_utilization);
+    kimchi.circleGaugeInit(result, "mem_utilization",gaugeValue+"%",gaugeValue);
 
     //Setup the VM Actions
     var guestActions=result.find("div[name=guest-actions]");
diff --git a/src/wok/plugins/kimchi/ui/pages/guest.html.tmpl b/src/wok/plugins/kimchi/ui/pages/guest.html.tmpl
index 78e9161..6c76720 100644
--- a/src/wok/plugins/kimchi/ui/pages/guest.html.tmpl
+++ b/src/wok/plugins/kimchi/ui/pages/guest.html.tmpl
@@ -33,6 +33,9 @@
             <div name="cpu_utilization" class="sortable">
                 <div class="circleGauge"></div>
             </div>
+            <div name="mem_utilization" class="sortable">
+                <div class="circleGauge"></div>
+            </div> 
             <div name="io_throughput" class="sortable">
                 <div class="circleGauge"></div>
                 <div class="subtitle">KB/s</div>
diff --git a/src/wok/plugins/kimchi/ui/pages/guests.html.tmpl b/src/wok/plugins/kimchi/ui/pages/guests.html.tmpl
index 529e0e2..dc94ea0 100644
--- a/src/wok/plugins/kimchi/ui/pages/guests.html.tmpl
+++ b/src/wok/plugins/kimchi/ui/pages/guests.html.tmpl
@@ -59,6 +59,7 @@
                 <ul class="list-title">
                     <li class="guest-type">$_("Name")</li>
                     <li class="guest-cpu">$_("CPU")</li>
+                    <li class="guest-memory">$_("Memory")</li>
                     <li class="guest-storage">$_("Disk I/O")</li>
                     <li class="guest-network">$_("Network I/O")</li>
                     <li class="guest-tile">$_("Livetile")</li>
-- 
1.9.1




More information about the Kimchi-devel mailing list