From 76262c22228cf55c734b95d800b29cc575215cea Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Sat, 2 Apr 2016 14:52:05 +0200 Subject: [PATCH 1/2] [Web UI] Add additional cpu stats refs #810 --- glances/outputs/static/html/plugins/cpu.html | 92 +++++++++++++++---- .../outputs/static/html/plugins/cpu_more.html | 26 ------ glances/outputs/static/html/stats.html | 5 +- .../static/js/services/plugins/glances_cpu.js | 10 +- 4 files changed, 86 insertions(+), 47 deletions(-) delete mode 100644 glances/outputs/static/html/plugins/cpu_more.html diff --git a/glances/outputs/static/html/plugins/cpu.html b/glances/outputs/static/html/plugins/cpu.html index 332317ba..68504282 100644 --- a/glances/outputs/static/html/plugins/cpu.html +++ b/glances/outputs/static/html/plugins/cpu.html @@ -1,22 +1,82 @@ -
-
-
CPU
-
{{ statsCpu.total }}%
-
-
-
user:
-
- {{ statsCpu.user }}% +
+
+
+
+
CPU
+
{{ statsCpu.total }}%
+
+
+
user:
+
+ {{ statsCpu.user }}% +
+
+
+
system:
+
+ {{ statsCpu.system }}% +
+
+
+
idle:
+
{{ statsCpu.idle }}%
+
-
-
system:
-
- {{ statsCpu.system }}% + -
-
idle:
-
{{ statsCpu.idle }}%
+
diff --git a/glances/outputs/static/html/plugins/cpu_more.html b/glances/outputs/static/html/plugins/cpu_more.html deleted file mode 100644 index c4f7e6cf..00000000 --- a/glances/outputs/static/html/plugins/cpu_more.html +++ /dev/null @@ -1,26 +0,0 @@ -
-
-
nice:
-
- {{ statsCpu.nice }}% -
-
-
-
irq:
-
- {{ statsCpu.irq }}% -
-
-
-
iowait:
-
- {{ statsCpu.iowait }}% -
-
-
-
steal:
-
- {{ statsCpu.steal }}% -
-
-
diff --git a/glances/outputs/static/html/stats.html b/glances/outputs/static/html/stats.html index 428522c7..5ea160f1 100644 --- a/glances/outputs/static/html/stats.html +++ b/glances/outputs/static/html/stats.html @@ -23,12 +23,9 @@ -
+
-
diff --git a/glances/outputs/static/js/services/plugins/glances_cpu.js b/glances/outputs/static/js/services/plugins/glances_cpu.js index 5835b209..cf71f8dd 100644 --- a/glances/outputs/static/js/services/plugins/glances_cpu.js +++ b/glances/outputs/static/js/services/plugins/glances_cpu.js @@ -1,7 +1,7 @@ glancesApp.service('GlancesPluginCpu', function() { var _pluginName = "cpu"; var _view = {}; - + this.total = null; this.user = null; this.system = null; @@ -10,6 +10,10 @@ glancesApp.service('GlancesPluginCpu', function() { this.irq = null; this.iowait = null; this.steal = null; + this.ctx_switches = null; + this.interrupts = null; + this.soft_interrupts = null; + this.syscalls = null; this.setData = function(data, views) { data = data[_pluginName]; @@ -23,6 +27,10 @@ glancesApp.service('GlancesPluginCpu', function() { this.irq = data.irq; this.iowait = data.iowait; this.steal = data.steal; + this.ctx_switches = Math.floor(data.ctx_switches / data.time_since_update); + this.interrupts = Math.floor(data.interrupts / data.time_since_update); + this.soft_interrupts = Math.floor(data.soft_interrupts / data.time_since_update); + this.syscalls = Math.floor(data.syscalls / data.time_since_update); } this.getDecoration = function(value) { From e548818725d1dc7c66d2336ff1f8f90757fa20bf Mon Sep 17 00:00:00 2001 From: Nicolas Hart Date: Sat, 2 Apr 2016 15:17:16 +0200 Subject: [PATCH 2/2] [Web UI] add decoration on cpu context switches --- glances/outputs/static/html/plugins/cpu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glances/outputs/static/html/plugins/cpu.html b/glances/outputs/static/html/plugins/cpu.html index 68504282..fb47dc72 100644 --- a/glances/outputs/static/html/plugins/cpu.html +++ b/glances/outputs/static/html/plugins/cpu.html @@ -55,7 +55,7 @@
ctx_sw:
-
+
{{ statsCpu.ctx_switches }}