From 77455bfb039809eb3cb68f97e374acccd904afb2 Mon Sep 17 00:00:00 2001 From: Xin Date: Wed, 21 Oct 2015 18:16:44 -0700 Subject: [PATCH] change JS files Change-Id: I7199c2a90c5b6d184ec20212469a3a13e1f4471e --- .../public/ui/scripts/scripts.ad7dd26a.js | 3 +++ .../public/ui/scripts/vendor.4e0e5b29.js | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 kb_server/public/ui/scripts/scripts.ad7dd26a.js create mode 100644 kb_server/public/ui/scripts/vendor.4e0e5b29.js diff --git a/kb_server/public/ui/scripts/scripts.ad7dd26a.js b/kb_server/public/ui/scripts/scripts.ad7dd26a.js new file mode 100644 index 0000000..adcf307 --- /dev/null +++ b/kb_server/public/ui/scripts/scripts.ad7dd26a.js @@ -0,0 +1,3 @@ +"use strict";angular.module("kbWebApp",["ngAnimate","ngCookies","ngResource","ngRoute","ngSanitize","ngTouch","ngTable","ui.bootstrap","angular-loading-bar","n3-line-chart"]).config(["$routeProvider",function(a){a.when("/About",{templateUrl:"views/about.html",controller:"AboutCtrl",controllerAs:"about"}).when("/Config",{templateUrl:"views/config.html",controller:"ConfigCtrl",controllerAs:"config"}).when("/ScaleTest",{templateUrl:"views/run.html",controller:"RunCtrl",controllerAs:"run"}).when("/IntervalReport",{templateUrl:"views/interval.html",controller:"IntervalCtrl",controllerAs:"interval"}).when("/Log",{templateUrl:"views/log.html",controller:"LogCtrl",controllerAs:"log"}).when("/Login",{templateUrl:"views/login.html",controller:"LoginCtrl",controllerAs:"login"}).otherwise({redirectTo:"/ScaleTest"})}]).config(["cfpLoadingBarProvider",function(a){a.latencyThreshold=1}]),angular.module("kbWebApp").controller("MainCtrl",["$scope","$http","$location","kbHttp","kbCookie",function(a,b,c,d,e){this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],d.getMethod("/kloudbuster/version").then(function(b){a.version=b.data},function(a){console.log("get version error:"),console.log(a)})}]).service("kbHttp",["$http","$q",function(a,b){var c="http://127.0.0.1:8080/api";this.getMethod=function(d){var e=b.defer();return a.get(c+d).then(function(a){e.resolve(a)},function(a){e.reject(a)}),e.promise},this.putMethod=function(d,e){var f=b.defer();return a.defaults.headers.put["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.put(c+d,"arg="+encodeURIComponent(JSON.stringify(e))).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise},this.postMethod=function(d,e){var f=b.defer();return e?(a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.post(c+d,"arg="+encodeURIComponent(JSON.stringify(e))).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise):(a.post(c+d).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise)},this.delMethod=function(d){var e=b.defer();return a["delete"](c+d).then(function(a){e.resolve(a)},function(a){e.reject(a)}),e.promise}}]).service("kbCookie",function(){this.init=function(){a="",b="",c="",d=""};var a="",a="858bcccc736b29d3718b6e5d82e5cdbb";this.getSessionID=function(){return a},this.setSessionID=function(b){return a=b};var b="";this.getStatus=function(){return b},this.setStatus=function(a){return b=a};var c="";this.getConfig=function(){return c},this.setConfig=function(a){return c=a};var d="";this.getCredentials=function(){return d},this.setCredentials=function(a){return d=a}}),angular.module("kbWebApp").controller("AboutCtrl",["$scope","$http","$location","kbHttp","kbCookie",function(a,b,c,d,e){this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],d.getMethod("/kloudbuster/version").then(function(b){a.version=b.data},function(a){console.log("get version error:"),console.log(a)})}]).service("kbHttp",["$http","$q",function(a,b){var c="http://127.0.0.1:8080/api";this.getMethod=function(d){var e=b.defer();return a.get(c+d).then(function(a){e.resolve(a)},function(a){e.reject(a)}),e.promise},this.getMethod2=function(d){var e=b.defer();return a.get(c+d,{ignoreLoadingBar:!0}).then(function(a){e.resolve(a)},function(a){e.reject(a)}),e.promise},this.putMethod=function(d,e){var f=b.defer();return a.defaults.headers.put["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.put(c+d,"arg="+encodeURIComponent(JSON.stringify(e))).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise},this.postMethod=function(d,e){var f=b.defer();return e?(a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=utf-8",a.post(c+d,"arg="+encodeURIComponent(JSON.stringify(e))).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise):(a.post(c+d).then(function(a){f.resolve(a)},function(a){f.reject(a)}),f.promise)},this.delMethod=function(d){var e=b.defer();return a["delete"](c+d).then(function(a){e.resolve(a)},function(a){e.reject(a)}),e.promise}}]).service("kbCookie",function(){this.init=function(){a="",b="",c="",d="",f="",g=0,e=""};var a="";this.getSessionID=function(){return a},this.setSessionID=function(b){return a=b};var b="";this.getStatus=function(){return b},this.setStatus=function(a){return b=a};var c="";this.getConfig=function(){return c},this.setConfig=function(a){return c=a};var d="";this.getCredentials=function(){return d},this.setCredentials=function(a){return d=a};var e="";this.getIsOneCloud=function(){return e},this.setIsOneCloud=function(a){return e=a};var f="";this.getTopology=function(){return f},this.setTopology=function(a){return f=a};var g=0;this.getLogOffset=function(){return g},this.setLogOffset=function(a){return g=a}}),angular.module("kbWebApp").controller("ConfigCtrl",["$scope","$http","$location","kbHttp","kbCookie",function(a,b,c,d,e){function f(){a.selectedA=[],a.selectedB=[],a.selectedC=[],j=[],a.listA=[],a.listB=[],a.listC=[],a.toggle=!1}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(a[d][c]===b)return d;return-1}function h(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1}function i(){a.selectedA=[],a.selectedB=[],a.selectedC=[],a.toggle=!1}this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],""===e.getSessionID()&&c.path("/Login"),a.sessionID=e.getSessionID(),a.status=e.getStatus(),a.dashstatus1="active",a.dashstatus1vis=!0,a.dashstatus2="",a.dashstatus2vis=!1,a.dashstatus3="",a.dashstatus3vis=!1,a.setDashStatus=function(b){1===b?(a.dashstatus2="",a.dashstatus2vis=!1,a.dashstatus3="",a.dashstatus3vis=!1,a.dashstatus1="active",a.dashstatus1vis=!0):2===b?(a.dashstatus1="",a.dashstatus1vis=!1,a.dashstatus3="",a.dashstatus3vis=!1,a.dashstatus2="active",a.dashstatus2vis=!0):3===b&&(a.dashstatus1="",a.dashstatus1vis=!1,a.dashstatus2="",a.dashstatus2vis=!1,a.dashstatus3="active",a.dashstatus3vis=!0)};var j;a.setUserData=function(b){var c,d=1;for(c in b)j.push({id:d++,firstName:b[c]});a.listA=j.slice(0,j.length),a.items=j},f(),a.aToB=function(){for(var b in a.selectedA){var c=g(a.items,a.selectedA[b],"id");a.listB.push(a.items[c]);var d=g(a.listA,a.selectedA[b],"id");a.listA.splice(d,1)}i()},a.aToC=function(){for(var b in a.selectedA){var c=g(a.items,a.selectedA[b],"id");a.listC.push(a.items[c]);var d=g(a.listA,a.selectedA[b],"id");a.listA.splice(d,1)}i()},a.bToA=function(){for(var b in a.selectedB){var c=g(a.items,a.selectedB[b],"id");a.listA.push(a.items[c]);var d=g(a.listB,a.selectedB[b],"id");a.listB.splice(d,1)}i()},a.cToA=function(){for(var b in a.selectedC){var c=g(a.items,a.selectedC[b],"id");a.listA.push(a.items[c]);var d=g(a.listC,a.selectedC[b],"id");a.listC.splice(d,1)}i()},a.toggleA=function(){if(a.selectedA.length>0)i();else for(var b in a.listA)a.selectedB=[],a.selectedC=[],a.selectedA.push(a.listA[b].id)},a.toggleB=function(){if(a.selectedB.length>0)i();else for(var b in a.listB)a.selectedA=[],a.selectedC=[],a.selectedB.push(a.listB[b].id)},a.toggleC=function(){if(a.selectedC.length>0)i();else for(var b in a.listC)a.selectedA=[],a.selectedB=[],a.selectedC.push(a.listC[b].id)},a.selectA=function(b){var c=h(a.selectedA,b);-1===c?a.selectedA.push(b):a.selectedA.splice(c,1)},a.selectB=function(b){var c=h(a.selectedB,b);-1===c?a.selectedB.push(b):a.selectedB.splice(c,1)},a.selectC=function(b){var c=h(a.selectedC,b);-1===c?a.selectedC.push(b):a.selectedC.splice(c,1)},a.checkStatus=function(){a.sessionID?d.getMethod2("/kloudbuster/status/"+a.sessionID).then(function(b){a.status=b.data.status,e.setStatus(a.status),a.configStatus()},function(a){console.log("get status error:"),console.log(a)}):(a.status="NO SESSION ID",e.setStatus(""))},a.checkStatus();var k=!1;a.disableConfig=function(a){$("#"+a).find("input").each(function(){$(this).attr("disabled","disabled")})},a.enableConfig=function(a){$("#"+a).find("input").each(function(){$(this).removeAttr("disabled")})},a.configStatus=function(){"READY"===a.status?k===!0&&(k=!1,a.enableConfig("stagingConfig2"),a.enableConfig("getButton")):k===!1&&(k=!0,a.disableConfig("stagingConfig2"),a.disableConfig("getButton")),e.getIsOneCloud()===!1&&a.disableConfig("topology")},a.getTopology=function(){d.getMethod("/config/hypervisor_list/"+a.sessionID).then(function(b){a.setUserData(b.data.server),console.log("get hypervisor list")},function(a){console.log("get hypervisor list error:"),console.log(a)})},a.getDefaultConfig=function(){d.getMethod("/config/default_config").then(function(b){e.setConfig(b.data),a.config=b.data,console.log("get & save default config")},function(a){console.log("get default config error:"),console.log(a)}),a.getTopology(),e.setTopology(""),a.availability_zone=1,j=[],f()},a.getRunConfig=function(){a.availability_zone=1,d.getMethod("/config/running_config/"+a.sessionID).then(function(b){e.setConfig(b.data),a.config=b.data,(null!=a.config.server.availability_zone&&""!=a.config.server.availability_zone||null!=a.config.client.availability_zone&&""!=a.client.server.availability_zone)&&(a.availability_zone=2),console.log("get & save running config")},function(a){console.log("get running config error:"),console.log(a)}),f(),a.getTopology(),d.getMethod("/config/topology_config/"+a.sessionID).then(function(b){if("null"!=b.data&&(0!=b.data.servers_rack.length||0!=b.data.clients_rack.length)){a.availability_zone=3,a.topology={servers_rack:b.data.servers_rack,clients_rack:b.data.clients_rack},e.setTopology(a.topology),console.log(b.data);for(var c in a.topology.servers_rack){var d=g(a.items,a.topology.servers_rack[c],"firstName");a.listC.push(a.items[d]);var f=g(a.listA,a.topology.servers_rack[c],"firstName");a.listA.splice(f,1)}for(var c in a.topology.clients_rack){var d=g(a.items,a.topology.clients_rack[c],"firstName");a.listB.push(a.items[d]);var f=g(a.listA,a.topology.clients_rack[c],"firstName");a.listA.splice(f,1)}}console.log("get & save topology config")},function(a){console.log("get topology config error:"),console.log(a)})},a.getRunConfig(),a.changeConfig=function(){if("READY"===a.status||""===a.status){if(e.setConfig(a.config),3==a.availability_zone){a.topology={servers_rack:[],clients_rack:[]};for(var b in a.listC)a.topology.servers_rack.push(a.listC[b].firstName);for(var b in a.listB)a.topology.clients_rack.push(a.listB[b].firstName);e.setTopology(a.topology),console.log(a.topology)}else e.setTopology({servers_rack:"",clients_rack:""});a.chaCon={kb_cfg:{},topo_cfg:{}},a.chaCon.kb_cfg=e.getConfig(),a.chaCon.topo_cfg=e.getTopology(),console.log(a.chaCon),d.putMethod("/config/running_config/"+a.sessionID,a.chaCon).then(function(a){console.log("change running config")},function(a){console.log("change running config error:"),console.log(a)})}else console.log("config not allow to change now!")},a.changeTopology=function(){1==a.availability_zone?(a.config.server.availability_zone="",a.config.client.availability_zone="",a.topology={},e.setTopology({servers_rack:"",clients_rack:""}),f(),a.getTopology()):2==a.availability_zone?(a.topology={},e.setTopology({servers_rack:"",clients_rack:""}),f(),a.getTopology()):3==a.availability_zone&&(a.config.server.availability_zone="",a.config.client.availability_zone="")}}]),angular.module("kbWebApp").controller("RunCtrl",["$scope","$timeout","$location","$http","$q","ngTableParams","kbCookie","kbHttp","interactiveMode","color",function(a,b,c,d,e,f,g,h,i,j){function k(a,b){var c=document.createElement("a"),d=new Blob([b]),e=document.createEvent("HTMLEvents");e.initEvent("click",!1,!1),c.download=a,c.href=URL.createObjectURL(d),c.dispatchEvent(e)}this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],""===g.getSessionID()&&c.path("/Login"),$("[data-toggle='.container']").click(function(){var a=$(this).data("toggle");$(a).toggleClass("open-sidebar"),$("#littleglyph").toggleClass("glyphicon-triangle-right"),$("#littleglyph").toggleClass("glyphicon-triangle-left")}),$(".swipe-area").swipe({swipeStatus:function(a,b,c,d,e,f){return"move"==b&&"right"==c?($(".container").addClass("open-sidebar"),!1):"move"==b&&"left"==c?($(".container").removeClass("open-sidebar"),!1):void 0}}),a.oneAtATime=!0,a.status1={isFirstOpen:!0,isFirstDisabled:!1},a.status2={isFirstOpen:!0,isFirstDisabled:!1},a.status3={isFirstOpen:!0,isFirstDisabled:!1},a.status1.open=!1,a.status2.open=!0,a.status3.open=!1,a.alerts=[],a.closeAlert=function(b){a.alerts.splice(b,1)},a.sessionID=g.getSessionID(),a.status=g.getStatus(),a.config=g.getConfig(),a.getRunConfig=function(){h.getMethod("/config/running_config/"+a.sessionID).then(function(b){a.config=b.data,g.setConfig(b.data),console.log("get & save config")},function(a){console.log("get running config error:"),console.log(a)})},a.sessionID&&!a.config&&a.getRunConfig(),a.setConfig=function(){var b=e.defer();return"READY"===a.status?(g.setConfig(a.config),a.chaCon={kb_cfg:{}},a.chaCon.kb_cfg=g.getConfig(),console.log(a.chaCon),h.putMethod("/config/running_config/"+a.sessionID,a.chaCon).then(function(a){console.log("change running config"),b.resolve(1)},function(a){console.log("change running config error:"),console.log(a),b.reject(0)})):"STAGED"===a.status?(a.config.client.http_tool_configs.report_interval=0,g.setConfig(a.config),a.chaCon={kb_cfg:{client:{http_tool_configs:{duration:a.config.client.http_tool_configs.duration,rate_limit:a.config.client.http_tool_configs.rate_limit,connections:a.config.client.http_tool_configs.connections,report_interval:0}}}},console.log(a.chaCon),h.putMethod("/config/running_config/"+a.sessionID,a.chaCon).then(function(a){console.log("change running config"),b.resolve(1)},function(a){console.log("change running config error:"),console.log(a),b.reject(0)})):(console.log("config not allow to change now!"),b.reject(0)),b.promise};var l=!1,m=!1;a.disableConfig=function(a){$("#"+a).find("input").each(function(){$(this).attr("disabled","disabled")})},a.enableConfig=function(a){$("#"+a).find("input").each(function(){$(this).removeAttr("disabled")})},a.configStatus=function(){"READY"===a.status?(l===!0&&(l=!1,a.enableConfig("stagingConfig"),a.enableConfig("stagingConfig1")),m===!0&&(m=!1,a.enableConfig("runningConfig"))):"STAGED"===a.status?(l===!1&&(l=!0,a.disableConfig("stagingConfig"),a.disableConfig("stagingConfig1")),m===!0&&(m=!1,a.enableConfig("runningConfig"))):(l===!1&&(l=!0,a.disableConfig("stagingConfig"),a.disableConfig("stagingConfig1")),m===!1&&(m=!0,a.disableConfig("runningConfig")))};var n=0;a.pointNum=function(){var a=".";n=(n+1)%6;for(var b=0;n>b;b++)a+=" .";return a},a.runButton="Run Test",a.runStatus=!0,a.setStatus=!1,a.setUnstage=!0,a.client_vm_count=0,a.server_vm_count=0,a.checkStatus=function(){a.sessionID?h.getMethod2("/kloudbuster/status/"+a.sessionID).then(function(b){a.status=b.data.status,g.setStatus(a.status),a.configStatus(),"READY"===a.status?(a.runButton="Create VMs",a.runStatus=!1,a.setStatus=!1,a.setUnstage=!0,a.client_vm_count=0,a.server_vm_count=0,$(".loading").addClass("pause"),a.info=""):"STAGING"===a.status?(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!0,a.client_vm_count=b.data.client_vm_count,a.server_vm_count=b.data.server_vm_count,$(".loading").removeClass("pause"),a.info="KloudBuster is Creating VM(s)"+a.pointNum()):"STAGED"===a.status?(a.runButton="Run Test",a.runStatus=!1,a.setStatus=!1,a.setUnstage=!1,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,a.getReport(),$(".loading").addClass("pause"),a.info=""):"RUNNING"===a.status?(a.runButton="Stop Test",a.runStatus=!1,a.setStatus=!0,a.setUnstage=!1,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,a.config.client.progression.enabled===!0&&a.getReport(),$(".loading").removeClass("pause"),a.info="KloudBuster is Running"+a.pointNum()):"ERROR"===a.status?(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!1,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").addClass("pause"),a.info=""):("CLEANING"===a.status||"STOPPING"===a.status)&&(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!0,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").removeClass("pause"),a.info="Please Wait"+a.pointNum())},function(a){console.log("get status error:"),console.log(a)}):(a.status="NO SESSION ID",g.setStatus(""))},a.checkStatus(),a.setStage=function(){h.postMethod("/kloudbuster/stage/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("set stage error:"),console.log(a)})},a.runKb=function(){h.postMethod("/kloudbuster/run_test/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("running error:"),console.log(a)})},a.stopKb=function(){h.postMethod("/kloudbuster/stop_test/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("stop error:"),console.log(a)})},a.scaleTest=function(){if("RUNNING"===a.status)a.stopKb();else{var b=a.setConfig();b.then(function(){"READY"===a.status?a.setStage():"STAGED"===a.status&&(a.initChart(),a.runKb())})}},a.CleanUp=function(){a.initChart(),a.sessionID?h.postMethod("/kloudbuster/cleanup/"+a.sessionID).then(function(b){a.checkStatus(),console.log("clean up successfully")},function(a){console.log("clean error:"),console.log(a)}):console.log("no sessionID")},a.tabledata=[],a.cols=[{field:"seq",title:"SEQ",sortable:"seq",show:!0},{field:"connection",title:"Connection",sortable:"connection",show:!0},{field:"server_vms",title:"Server VMs",sortable:"server_vms",show:!0},{field:"requests",title:"Requests",sortable:"requests",show:!0},{field:"sock_err",title:"Error",sortable:"sock_err",show:!0},{field:"rps",title:"RPS measured",sortable:"rps",show:!0},{field:"rate_limit",title:"RPS requested",sortable:"rate_limit",show:!0},{field:"throughput",title:"Throughput",sortable:"throughput",show:!0},{field:"action",title:"Action",sortable:"action",show:!0}],a.tableParams=new f({sorting:{name:"asc"},count:10},{counts:[],data:a.tabledata}),a.options={axes:{x:{key:"x",type:"linear",ticksFormatter:function(a){return 0===a?"50%":10===a?"75%":20===a?"90%":30===a?"99%":40===a?"99.9%":50===a?"99.99%":60===a?"99.999%":void 0}},y:{type:"log",ticksFormat:"d",innerTicks:!0,grid:!0}},tooltip:{mode:"scrubber",formatter:function(a,b,c){return c.label+":"+b}},tension:.8,lineMode:"cardinal",series:[{}]},a.initChart=function(){a.data=[{x:0},{x:10},{x:20},{x:30},{x:40},{x:50},{x:60}],a.options.series=[{}],a.isDely=!1,a.tabledata.length=0,a.tableParams.reload(),a.isDely=!1,o=0,j.reset()};var o=0;a.initChart(),a.refreshChart=function(){a.data=[{x:0},{x:10},{x:20},{x:30},{x:40},{x:50},{x:60}],a.options.series=[{}],a.isDely=!1,a.tabledata.length=0,a.tableParams.reload(),j.reset()},a.getReport=function(){h.getMethod2("/kloudbuster/report/"+a.sessionID+"?final=true").then(function(b){if(console.log("get report totally:"+b.data.length),console.log(b.data),b.data.length>0&&oc;c++){a.result=b.data[c];var d=j.getColor();a.config.client.progression.enabled?(console.log("show report"+a.name),a.pushChartData("Connection-"+a.result.total_connections,a.result,d),a.pushTableData("Connection-"+a.result.total_connections,a.result,d)):(console.log("show report"+a.name),a.pushChartData("Final",a.result,d),a.pushTableData("Final",a.result,d))}}},function(a){console.log("get report error:"),console.log(a)})},a.pushChartData=function(b,c,d){console.log("chart date"+b),a.isDely===!1&&(a.options.series.shift(),a.isDely=!0),a.options.series.push({y:b,label:b,color:d,dotSize:"3",thickness:"2px"});for(var e=0;7>e;e++)a.data[e][b]=c.latency_stats[e][1]/1e3},a.pushTableData=function(b,c,d){console.log("table date:"+b);var e=8*c.http_throughput_kbytes/1e6;a.tabledata.push({seq:b,connection:c.total_connections,server_vms:c.total_server_vms,requests:c.http_total_req,sock_err:c.http_sock_err+c.http_sock_timeout,rps:c.http_rps,rate_limit:c.http_rate_limit,throughput:e.toFixed(2),description:c.description,color:d}),a.tableParams.reload()},a.saveResult=function(a){var b=new Date,c=b.getMonth()+1,d=b.getDate(),e=b.getHours(),f=b.getMinutes(),g=c+"_"+d+"_"+e+"_"+f+"_"+a+".json",h=i.getResult();""!=h[a]?k(g,JSON.stringify(h[a])):console.log("no file to save")},setInterval(function(){a.checkStatus()},2e3)}]).service("interactiveMode",function(){var a=[];this.getResult=function(){return a},this.setResult=function(b){return a=b}}).service("color",function(){var a=0,b=["#F44336","#673AB7","#03A9F4","#4CAF50","#FFEB3B","#BF360C","#795548","#E91E63","#3F51B5","#00BCD4","#CDDC39","#FF9800","#9E9E9E","#9C27B0","#009688"],c=b.length;this.getColor=function(){return a=(a+1)%c,b[a]},this.reset=function(){a=0}}).directive("convertToNumber",function(){return{require:"ngModel",link:function(a,b,c,d){d.$parsers.push(function(a){return parseFloat(a)}),d.$formatters.push(function(a){return""+a})}}}),angular.module("kbWebApp").controller("LogCtrl",["$scope","$compile","$http","$location","kbHttp","kbCookie",function(a,b,c,d,e,f){this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],""===f.getSessionID()&&d.path("/Login"),String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(a,"gm"),b)},a.sessionID=f.getSessionID(),a.status=f.getStatus(),a.logs="",a.logOffset=0,a.delLog=function(){f.setLogOffset(a.logOffset),$("#cc").empty(),a.getLog()},a.getLog=function(){a.sessionID?e.getMethod("/kloudbuster/log/"+a.sessionID+"?offset="+f.getLogOffset()).then(function(b){b.data=b.data.substring(1,b.data.length-1),a.logOffset=f.getLogOffset()+b.data.length-1,a.logs=b.data.split("\\n"),$("#cc").empty();for(var c in a.logs)a.logs[c]=a.logs[c].replace(/ /g," "),$("#cc").append(a.logs[c]+"
")},function(a){console.log("get Log error:"),console.log(a)}):console.log("not connected "+a.status+","+a.sessionID)},a.getLog()}]),angular.module("kbWebApp").controller("IntervalCtrl",["$scope","$http","kbHttp","$q","$location","kbCookie","monitorMode",function(a,b,c,d,e,f,g){function h(a,b){var c=document.createElement("a"),d=new Blob([b]),e=document.createEvent("HTMLEvents");e.initEvent("click",!1,!1),c.download=a,c.href=URL.createObjectURL(d),c.dispatchEvent(e)}this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],""===f.getSessionID()&&e.path("/Login"),$("[data-toggle='.container']").click(function(){var a=$(this).data("toggle");$(a).toggleClass("open-sidebar"),$("#littleglyph1").toggleClass("glyphicon-triangle-right"),$("#littleglyph1").toggleClass("glyphicon-triangle-left")}),$(".swipe-area").swipe({swipeStatus:function(a,b,c,d,e,f){return"move"==b&&"right"==c?($(".container").addClass("open-sidebar"),!1):"move"==b&&"left"==c?($(".container").removeClass("open-sidebar"),!1):void 0}}),a.oneAtATime=!0,a.status1={isFirstOpen:!0,isFirstDisabled:!1},a.status2={isFirstOpen:!0,isFirstDisabled:!1},a.status1.open=!1,a.status2.open=!0,a.alerts=[],a.closeAlert=function(b){a.alerts.splice(b,1)},a.sessionID=f.getSessionID(),a.status=f.getStatus(),a.config=f.getConfig(),a.getRunConfig=function(){c.getMethod("/config/running_config/"+a.sessionID).then(function(b){a.config=b.data,f.setConfig(b.data),console.log("get & save config")},function(a){console.log("get running config error:"),console.log(a)})},a.sessionID&&!a.config&&a.getRunConfig(),a.setConfig=function(){var b=d.defer();if("READY"===a.status)a.config.client.progression.enabled=!1,f.setConfig(a.config),a.chaCon={kb_cfg:{}},a.chaCon.kb_cfg=f.getConfig(),c.putMethod("/config/running_config/"+a.sessionID,a.chaCon).then(function(a){console.log("change running config"),b.resolve(1)},function(a){console.log("change running config error:"),console.log(a),b.reject(0)});else if("STAGED"===a.status){if(a.config.client.progression.enabled===!0)return alert("Can't Run Monitor Test Now! You have chosen Progression Test. Clean Up First!"),b.reject(0),b.promise;f.setConfig(a.config),a.chaCon={kb_cfg:{client:{http_tool_configs:{duration:a.config.client.http_tool_configs.duration,rate_limit:a.config.client.http_tool_configs.rate_limit,connections:a.config.client.http_tool_configs.connections,report_interval:a.config.client.http_tool_configs.report_interval}}}},console.log(a.chaCon),c.putMethod("/config/running_config/"+a.sessionID,a.chaCon).then(function(a){console.log("change running config"),b.resolve(1)},function(a){console.log("change running config error:"),console.log(a),b.reject(0)})}else console.log("config not allow to change now!"),b.reject(0);return b.promise};var i=!1,j=!1;a.disableConfig=function(a){$("#"+a).find("input").each(function(){$(this).attr("disabled","disabled")})},a.enableConfig=function(a){$("#"+a).find("input").each(function(){$(this).removeAttr("disabled")})},a.configStatus=function(){"READY"===a.status?(i===!0&&(i=!1,a.enableConfig("stagingConfig")),j===!0&&(j=!1,a.enableConfig("runningConfig"))):"STAGED"===a.status?(i===!1&&(i=!0,a.disableConfig("stagingConfig")),j===!0&&(j=!1,a.enableConfig("runningConfig"))):(i===!1&&(i=!0,a.disableConfig("stagingConfig")),j===!1&&(j=!0,a.disableConfig("runningConfig")))};var k=0;a.pointNum=function(){var a=".";k=(k+1)%6;for(var b=0;k>b;b++)a+=" .";return a},a.runButton="Run Test",a.runStatus=!0,a.setStatus=!1,a.setUnstage=!0,a.client_vm_count=0,a.server_vm_count=0,a.checkStatus=function(){a.sessionID?c.getMethod2("/kloudbuster/status/"+a.sessionID).then(function(b){a.status=b.data.status,a.configStatus(),f.setStatus(a.status),"READY"===a.status?(a.runButton="Create VMs",a.runStatus=!1,a.setStatus=!1,a.setUnstage=!0,a.client_vm_count=0,a.server_vm_count=0,$(".loading").addClass("pause"),a.info=""):"STAGING"===a.status?(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!0,a.client_vm_count=b.data.client_vm_count,a.server_vm_count=b.data.server_vm_count,$(".loading").removeClass("pause"),a.info="KloudBuster is Creating VM(s)"+a.pointNum()):"STAGED"===a.status?(a.runButton="Run Test",a.runStatus=!1,a.setStatus=!1,a.setUnstage=!1,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").addClass("pause"),a.info=""):"RUNNING"===a.status?(a.runButton="Stop Test",a.runStatus=!1,a.setStatus=!0,a.setUnstage=!1,a.getSeqReport(),a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").removeClass("pause"),a.info="KloudBuster is Running"+a.pointNum()):"ERROR"===a.status?(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!1,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").addClass("pause"),a.info=""):("CLEANING"===a.status||"STOPPING"===a.status)&&(a.runButton="Run Test",a.runStatus=!0,a.setStatus=!0,a.setUnstage=!0,a.client_vm_count=a.config.server.routers_per_tenant*a.config.server.networks_per_router*a.config.server.vms_per_network*a.config.server.number_tenants,a.server_vm_count=a.client_vm_count,$(".loading").removeClass("pause"),a.info="Please Wait"+a.pointNum())},function(a){console.log("get status error:"),console.log(a)}):a.status="NO SESSION ID"},a.checkStatus(),a.setStage=function(){c.postMethod("/kloudbuster/stage/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("set stage error:"),console.log(a)})},a.runKb=function(){c.postMethod("/kloudbuster/run_test/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("running error:"),console.log(a)})},a.stopKb=function(){c.postMethod("/kloudbuster/stop_test/"+a.sessionID).then(function(b){a.checkStatus()},function(a){console.log("stop error:"),console.log(a)})},a.scaleTest=function(){if("RUNNING"===a.status)a.stopKb();else{var b=a.setConfig();b.then(function(){"READY"===a.status?a.setStage():"STAGED"===a.status&&(a.config.client.progression.enabled===!0?alert("Can't Run Monitor Test Now! You have chosen Progression Test. Clean Up First!"):(a.initChart(),a.runKb()))})}},a.CleanUp=function(){a.initChart(),a.sessionID?c.postMethod("/kloudbuster/cleanup/"+a.sessionID).then(function(b){a.checkStatus(),console.log("clean up successfully")},function(a){console.log("clean error:"),console.log(a)}):console.log("no sessionID")},a.data=[{x:new Date}],a.isDely=!1;var l=0;a.initChart=function(){a.data=[{x:new Date}],a.isDely=!1,l=0,g.setResult("")},a.options={axes:{x:{type:"date"},y:{type:"log",ticksFormat:"d",innerTicks:!0,grid:!0}},series:[{y:"val_6",label:"99.999%",type:"area",color:"#084594",dotSize:"0",thickness:"2px"},{y:"val_5",label:"99.99%",type:"area",color:"#2171b5",dotSize:"0",thickness:"2px",visible:!1},{y:"val_4",label:"99.9%",type:"area",color:"#4292c6",dotSize:"0",thickness:"2px",visible:!1},{y:"val_3",label:"99%",type:"area",color:"#6baed6",dotSize:"0",thickness:"2px"},{y:"val_2",label:"90%",type:"area",color:"#9ecae1",dotSize:"0",thickness:"2px"},{y:"val_1",label:"75%",type:"area",color:"#c6dbef",dotSize:"0",thickness:"2px",visible:!1},{y:"val_0",label:"50%",type:"area",color:"#eff3ff",dotSize:"0",thickness:"2px"}],tooltip:{mode:"scrubber",formatter:function(a,b,c){return c.label+":"+b}},tension:.9,lineMode:"cardinal"},a.data.forEach(function(a){a.x=new Date(a.x)}),a.getSeqReport=function(){c.getMethod2("/kloudbuster/report/"+a.sessionID).then(function(b){a.result=b.data.report,a.seq=b.data.seq,console.log("get seq report:"+a.seq),a.seq&&a.seq>l&&(l=a.seq,a.data.length>40&&a.data.shift(),a.pushChartData("SEQ_"+a.seq,a.result))},function(a){console.log("get seq report error:"),console.log(a)})},a.pushChartData=function(b,c){a.isDely===!1&&(a.data.shift(),a.isDely=!0),a.data.push({x:new Date,val_0:c.latency_stats[0][1]/1e3,val_1:c.latency_stats[1][1]/1e3,val_2:c.latency_stats[2][1]/1e3,val_3:c.latency_stats[3][1]/1e3,val_4:c.latency_stats[4][1]/1e3,val_5:c.latency_stats[5][1]/1e3,val_6:c.latency_stats[6][1]/1e3}),g.setResult(a.data)},g.getResult()&&(a.data=g.getResult()),a.saveResult=function(){var a=new Date,b=a.getMonth()+1,c=a.getDate(),d=a.getHours(),e=a.getMinutes(),f=b+"_"+c+"_"+d+"_"+e+".json";console.log(f),""!=g.getResult()?h(f,JSON.stringify(g.getResult())):console.log("no file to save")},setInterval(function(){a.checkStatus()},2e3)}]).service("monitorMode",function(){var a="";this.getResult=function(){return a},this.setResult=function(b){return a=b}}),angular.module("kbWebApp").controller("LoginCtrl",["$scope","$http","$location","kbHttp","kbCookie",function(a,b,c,d,e){function f(a){var b=a.target.files,c=b[0],d=new FileReader;d.onload=function(){h=this.result},d.readAsText(c)}function g(a){var b=a.target.files,c=b[0],d=new FileReader;d.onload=function(){i=this.result},d.readAsText(c)}this.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],a.deleteSession=function(){d.delMethod("/config/running_config/"+a.sessionID).then(function(a){console.log("del sessionID")},function(a){console.log("delete error:"),console.log(a)})},a.CleanUp=function(){d.postMethod("/kloudbuster/cleanup/"+a.sessionID).then(function(a){console.log("clean up successfully")},function(a){console.log("clean error:"),console.log(a)})},""!=e.getSessionID()&&(a.sessionID=e.getSessionID(),"READY"!=e.getStatus()&&a.CleanUp(),a.deleteSession(),e.init()),a.samecloud=!0,a.clouds=function(){a.samecloud===!0?($("#inputPassword2").attr("disabled",!0),$("#file2").attr("disabled",!0)):($("#inputPassword2").attr("disabled",!1),$("#file2").attr("disabled",!1)); +};var h;document.getElementById("file1").addEventListener("change",f,!1);var i;document.getElementById("file2").addEventListener("change",g,!1),a.setConfig=function(){a.samecloud===!0?(e.setIsOneCloud(!0),a.credentials={"tested-passwd":a.inputPassword1,"tested-rc":h,"testing-passwd":"","testing-rc":""}):(e.setIsOneCloud(!1),a.credentials={"tested-passwd":a.inputPassword1,"tested-rc":h,"testing-passwd":inputPassword2,"testing-rc":i}),a.runCon={credentials:{},kb_cfg:""},console.log(a.credentials),a.runCon.credentials=a.credentials,e.setCredentials(a.credentials),d.postMethod("/config/running_config",a.runCon).then(function(b){e.setSessionID(b.data),a.sessionID=e.getSessionID(),console.log("set config & get sesID:"+a.sessionID),c.path("/")},function(a){console.log("set config error:"),console.log(a)})}}]),angular.module("kbWebApp").run(["$templateCache",function(a){a.put("views/about.html",'

KloudBuster

{{version}}

Splendid!

'),a.put("views/config.html",'

VM Creation Concurrency:


VM PLACEMENT


For Server:
For Client:
Server Pool {{user.firstName}}
Available Hypervisors {{user.firstName}}
Client Pool {{user.firstName}}
Html Payload Size:

flavor
vCPUs:

RAM (KB):

Disk (GB):
flavor
vCPUs:

RAM (KB):

Disk (GB):
'),a.put("views/interval.html",'
Latency(ms)

'),a.put("views/log.html",'
LOGS
'),a.put("views/login.html",'

Server Cloud

Password

Client Cloud

Password

'),a.put("views/main.html",'

KloudBuster

{{version}}

Splendid!

'),a.put("views/run.html",'
Latency(ms)
cols to show
       {{row.connection}} {{row.server_vms}} {{row.requests}} {{row.sock_err}} {{row.rps}} {{row.rate_limit}} {{row.throughput}} Gbps
'); +}]); \ No newline at end of file diff --git a/kb_server/public/ui/scripts/vendor.4e0e5b29.js b/kb_server/public/ui/scripts/vendor.4e0e5b29.js new file mode 100644 index 0000000..eff75e0 --- /dev/null +++ b/kb_server/public/ui/scripts/vendor.4e0e5b29.js @@ -0,0 +1,21 @@ +if(function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c}catch(e){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("