diff --git a/src/httprest.py b/src/httprest.py index 08f11f9..5d283bc 100755 --- a/src/httprest.py +++ b/src/httprest.py @@ -342,7 +342,8 @@ class DockletHttpHandler(http.server.BaseHTTPRequestHandler): res['mem_use'] = fetcher.get_mem_use(cmds[2]) elif cmds[3] == 'basic_info': res['basic_info'] = fetcher.get_basic_info(cmds[2]) - self.response(200, {'success':'true', 'monitor':res}) + user_info = G_usermgr.selfQuery(cur_user = cur_user) + self.response(200, {'success':'true', 'monitor':res, 'groupinfo':user_info['data']['groupinfo']}) elif cmds[1] == 'user': if not user == 'root': self.response(400, {'success':'false', 'message':'Root Required'}) diff --git a/web/static/js/plot_monitor.js b/web/static/js/plot_monitor.js index 5dcb2f7..c3729b1 100755 --- a/web/static/js/plot_monitor.js +++ b/web/static/js/plot_monitor.js @@ -7,9 +7,9 @@ function processMemData(data) mem_usedp = data.monitor.mem_use.usedp; var usedp = data.monitor.mem_use.usedp; var unit = data.monitor.mem_use.unit; - var quota = data.monitor.mem_use.quota; + var quota = data.groupinfo.memory; var val = data.monitor.mem_use.val; - var out = "("+val+unit+"/"+quota+unit+")"; + var out = "("+val+unit+"/"+quota+"MB)"; $("#con_mem").html((usedp/0.01).toFixed(2)+"%
"+out); } function getMemY() @@ -21,7 +21,10 @@ function processCpuData(data) cpu_usedp = data.monitor.cpu_use.usedp; var val = data.monitor.cpu_use.val; var unit = data.monitor.cpu_use.unit; + var quota = data.groupinfo.cpu; + quota = quota/1000.0; $("#con_cpu").html(val +" "+ unit); + $("#con_cpuquota").html(quota.toFixed(2)+"% Cores"); } function getCpuY() { diff --git a/web/templates/monitor/status.html b/web/templates/monitor/status.html index 24e860c..826fa6e 100644 --- a/web/templates/monitor/status.html +++ b/web/templates/monitor/status.html @@ -34,13 +34,14 @@ - - + + - - - + + + + @@ -56,6 +57,7 @@ {% endif %} + @@ -97,21 +99,25 @@ $("#"+index+"_pid").html('--'); $("#"+index+"_ip").html('--'); $("#"+index+"_cpu").html('--'); + $("#"+index+"_cpuquota").html('--'); $("#"+index+"_mem").html('--'); return; } $.post(url+"/cpu_use",{},function(data){ var usedp = data.monitor.cpu_use.usedp; + var quota = data.groupinfo.cpu; + quota = quota/100000.0; $("#"+index+"_cpu").html((usedp/0.01).toFixed(2)+"%"); + $("#"+index+"_cpuquota").html((quota*100).toFixed(2)+"% Cores"); },"json"); $.post(url+"/mem_use",{},function(data){ var usedp = data.monitor.mem_use.usedp; var unit = data.monitor.mem_use.unit; - var quota = data.monitor.mem_use.quota; + var quota = data.groupinfo.memory; var val = data.monitor.mem_use.val; - var out = "("+val+unit+"/"+quota+unit+")"; + var out = "("+val+unit+"/"+quota+"MB)"; $("#"+index+"_mem").html((usedp/0.01).toFixed(2)+"%
"+out); },"json"); diff --git a/web/templates/monitor/statusRealtime.html b/web/templates/monitor/statusRealtime.html index 42b1e15..77ec738 100644 --- a/web/templates/monitor/statusRealtime.html +++ b/web/templates/monitor/statusRealtime.html @@ -43,6 +43,7 @@ + @@ -57,6 +58,7 @@ {% endif %} +
Node IDNode NameNode IDNode Name IP Address StatusCpu usedMem usedSummaryCpu usedCpu quotaMem usedSummary
Running
---- -- RealtimeState IP Address CPU UseCPU Quota Mem Use
{{ container['IP'] }}---- --