From 49bea2f5945ea70d2b69620e235653751d3bcd7a Mon Sep 17 00:00:00 2001 From: luqiong <605601787@qq.com> Date: Wed, 24 Sep 2014 17:00:53 +0800 Subject: [PATCH] add preface of target model add preface of target model --- .../webapp/WEB-INF/classes/i18n_en.properties | 11 ++- .../webapp/WEB-INF/classes/i18n_zh.properties | 11 ++- Bench4Q-Web/src/main/webapp/css/test.css | 13 +++- .../webapp/script/TestPlan/TestPlanServer.js | 14 +++- .../main/webapp/script/TestPlan/TestPlanUI.js | 72 +++++++++++++++++++ .../src/main/webapp/script/TestPlan/test.js | 1 + Bench4Q-Web/src/main/webapp/test.jsp | 55 ++++++++++++++ 7 files changed, 173 insertions(+), 4 deletions(-) diff --git a/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_en.properties b/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_en.properties index 375e3d63..1685aa2e 100644 --- a/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_en.properties +++ b/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_en.properties @@ -212,4 +212,13 @@ startRecording=startRecording stopRecording=Stop Recording custom-mode=Custom Mode target-mode=Target Mode -load-mode=Load Mode \ No newline at end of file +load-mode=Load Mode +target-type=Target Type +affairs-name=Affairs Name +target-value=Target Value +cpu-threshold=CPU Threshold +stress-control=Stress Control +initial-users=Initial Users +maximum-users=Maximum Users +time-interval=Time Interval +increase-users=Increase Users \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_zh.properties b/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_zh.properties index 1dfb16ef..43259be3 100644 --- a/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_zh.properties +++ b/Bench4Q-Web/src/main/webapp/WEB-INF/classes/i18n_zh.properties @@ -213,4 +213,13 @@ startRecording=\u5f00\u59cb\u5f55\u5236 stopRecording=\u505C\u6B62\u5f55\u5236 custom-mode=\u5E38\u89C4\u6A21\u5F0F target-mode=\u76EE\u6807\u6A21\u5F0F -load-mode=\u65BD\u538B\u6A21\u5F0F \ No newline at end of file +load-mode=\u65BD\u538B\u6A21\u5F0F +target-type=\u76EE\u6807\u7C7B\u578B +affairs-name=\u4E8B\u52A1\u540D +target-value=\u76EE\u6807\u503C +cpu-threshold=\u9650\u5236\u9608\u503C +stress-control=\u538B\u529B\u63A7\u5236 +initial-users=\u521D\u59CB\u7528\u6237\u6570 +maximum-users=\u6700\u5927\u7528\u6237\u6570 +time-interval=\u65F6\u95F4\u95F4\u9694 +increase-users=\u589E\u52A0\u7528\u6237 \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/css/test.css b/Bench4Q-Web/src/main/webapp/css/test.css index dbb94f2f..773ba3fd 100644 --- a/Bench4Q-Web/src/main/webapp/css/test.css +++ b/Bench4Q-Web/src/main/webapp/css/test.css @@ -60,14 +60,22 @@ padding:0; } select{ margin-bottom:0px; + width:75%; } #highchartsPlot{ margin-left:10%; margin-top:10px; margin-bottom:10px; width:65%; - } + +#highchartsPlot2{ + margin-left:10%; + margin-top:10px; + margin-bottom:10px; + width:65%; +} + .centre{ margin:20px; margin-left:290px; @@ -129,4 +137,7 @@ div#test-plan-continuous{ } .modeSelectTitle{ margin-right:15px; +} +div#test-plan-continuous2{ + width:100%; } \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js index b082f423..f6dd6c0b 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanServer.js @@ -145,7 +145,19 @@ function loadLimitableFields(){ information(data.failedMessage); return; }else{ - data.limitableFields.fields;//this is list, limitable fields' name + //this is list, limitable fields' name + data = data.limitableFields.fields; + var script = new Array(); + for ( var i = 0; i < data.length; i++) + script.push(data[i]); + for ( var j = 0; j < script.length; j++) { + var textNode = document.createTextNode(script[j]); + var optionNode = document.createElement("option"); + optionNode.setAttribute("value", script[j]); + optionNode.appendChild(textNode); + var selectNode = document.getElementsByName("select-target-type")[0]; + selectNode.appendChild(optionNode); + } } }).error(function(){ information($.i18n.prop('failed-connect-server')); diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js index beac6fe3..f05b58cb 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/TestPlanUI.js @@ -114,4 +114,76 @@ function toggleIpConfig() { function changeMode(newModeId, oldModeId){ $("#"+oldModeId).addClass("hide"); $("#"+newModeId).removeClass("hide"); + if(newModeId=='targetMode') + loadSchedulePlot2(); + else + loadSchedulePlot(); +} + +function loadSchedulePlot2() { + var options = { + chart : { + renderTo : 'highchartsPlot2', + defaultSeriesType : 'line', + type : 'area', + height : 300, + }, + plotOptions : { + series : { + fillOpacity : 0.85, + color : '#369bd7' + } + }, + credits : { + enabled : false + }, + legend : { + enabled : false + }, + title : { + text : $.i18n.prop('test-loadSchedule') , + x : -50 + }, + xAxis : { + plotLines : [ { + width : 10, + color : '#808080' + } ], + min : 0, + title : { + text : 'Time(s)' + } + }, + yAxis : { + plotLines : [ { + value : 0, + width : 1, + color : '#808080' + } ], + title : { + text : 'Users' + }, + min : 0 + }, + tooltip : { + formatter : function() { + var formatStr = ''+this.y+ ' users after ' + this.x + ' seconds'; + return formatStr; + } + }, + series : [ { + data : [[ 0 , 0 ]] + } ] + }; + var InitialUsers = parseInt($('input[name="initial-users"]').val()); + var MaxUsers = parseInt($('input[name="maximum-users"]').val()); + var TimeInterval = parseInt($('input[name="time-interval"]').val()); + var IncreaseUsers = parseInt($('input[name="increase-users"]').val()); + var time = 0; + for(var i = InitialUsers; i <= MaxUsers; i+=IncreaseUsers){ + time += TimeInterval; + options.series[0].data.push([time,i]); + } + var chart = new Highcharts.Chart(options); + currentChart = chart; } \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js b/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js index 2b958663..cd8481c6 100644 --- a/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js +++ b/Bench4Q-Web/src/main/webapp/script/TestPlan/test.js @@ -1,6 +1,7 @@ var currentChart; $(document).ready(function() { loadScripts(); + loadLimitableFields(); loadSchedulePlot(); loadFilterTypeList(); }); diff --git a/Bench4Q-Web/src/main/webapp/test.jsp b/Bench4Q-Web/src/main/webapp/test.jsp index a4ea254b..ad9d69b7 100644 --- a/Bench4Q-Web/src/main/webapp/test.jsp +++ b/Bench4Q-Web/src/main/webapp/test.jsp @@ -147,6 +147,61 @@ body {
+
+
+ + + + + + + + + + + + + + + + + +
cpu
%
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
all input can not be empty
and must be greater than zero!