From 246acb6b6e1bae7b25039b7b8cda24a846d5d851 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 30 Sep 2015 18:45:12 +0530 Subject: [PATCH] metrics: add thresholds to zone metrics view Signed-off-by: Rohit Yadav --- ui/scripts/metrics.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/ui/scripts/metrics.js b/ui/scripts/metrics.js index a37d43252b8..87f933ee25a 100644 --- a/ui/scripts/metrics.js +++ b/ui/scripts/metrics.js @@ -62,6 +62,11 @@ columns: { cpuusedavg: { label: 'label.cpu.used.avg', + thresholdcolor: true, + thresholds: { + notification: 'cpunotificationthreshold', + disable: 'cpudisablethreshold' + } }, cpumaxdev: { label: 'label.cpu.max.dev' @@ -73,7 +78,12 @@ collapsible: true, columns: { cpuallocated: { - label: 'label.allocated' + label: 'label.allocated', + thresholdcolor: true, + thresholds: { + notification: 'cpunotificationthreshold', + disable: 'cpudisablethreshold' + } }, cputotal: { label: 'label.cpu.total.ghz' @@ -85,7 +95,12 @@ collapsible: true, columns: { memusedavg: { - label: 'label.memory.used.avg' + label: 'label.memory.used.avg', + thresholdcolor: true, + thresholds: { + notification: 'memnotificationthreshold', + disable: 'memdisablethreshold' + } }, memmaxdev: { label: 'label.memory.max.dev' @@ -97,7 +112,12 @@ collapsible: true, columns: { memallocated: { - label: 'label.allocated' + label: 'label.allocated', + thresholdcolor: true, + thresholds: { + notification: 'memnotificationthreshold', + disable: 'memdisablethreshold' + } }, memtotal: { label: 'label.memory.total.gb' @@ -125,6 +145,12 @@ items[idx].memallocated = 0.0; items[idx].maxMemUsed = 0; + // Threshold color coding + items[idx].cpunotificationthreshold = 0.0; + items[idx].cpudisablethreshold = 0.0; + items[idx].memnotificationthreshold = 0.0; + items[idx].memdisablethreshold = 0.0; + $.ajax({ url: createURL('listClusters'), data: {zoneid: zone.id},