forked from intel-cloud/cosbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
intel-cloud#5 real-time performance graph
- Loading branch information
Showing
9 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
dev/cosbench-controller-web/WEB-INF/freemarker/finalchart.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script type="text/javascript"> | ||
function custage(){ | ||
var d=document.getElementById("cstage").value; | ||
var element = document.getElementById("fchart") | ||
element.style.display =""; | ||
if(d=="close"){ | ||
element.style.display ="none"; | ||
return; | ||
} | ||
<#list info.stageInfos as sInfo > | ||
var id="${sInfo.id}"; | ||
if(id==d){ | ||
var i=0; | ||
//bandwidth | ||
var ybandwidth=new Array(); | ||
var xvalue=new Array(); | ||
var bandwidthname="bandwidth"; | ||
var bandwidthsp="KB/S"; | ||
var bandwidth=""; | ||
//throughput | ||
var ythroughput=new Array(); | ||
var throughputname="throughput"; | ||
var throughputsp="op/s"; | ||
var throughput=""; | ||
//restime | ||
var yRestime=new Array(); | ||
var avgResTime=""; | ||
var avgResTimename="resTime"; | ||
var avgResTimesp="ms"; | ||
//ratio | ||
var yratio=new Array(); | ||
var rationame="ratio"; | ||
var ratiosp="%"; | ||
var ratio=""; | ||
<#list sInfo.snapshots as snapshot> | ||
<#list snapshot.report.allMetrics as mInfo> | ||
// bandwidth | ||
bandwidth="${mInfo.bandwidth}"; | ||
bandwidth=bandwidth.replace(/,/gi,''); | ||
ybandwidth.push(Math.round(eval(bandwidth/1024))); | ||
// throughput | ||
throughput="${mInfo.throughput}"; | ||
throughput=throughput.replace(/,/gi,''); | ||
ythroughput.push(Math.round(eval(throughput))); | ||
//resTime | ||
avgResTime="${mInfo.avgResTime}"; | ||
avgResTime=avgResTime.replace(/,/gi,''); | ||
yRestime.push(Math.round(eval(avgResTime))); | ||
//Succ-Ratio | ||
ratio="${mInfo.ratio}"; | ||
ratio=ratio.replace(/,/gi,''); | ||
yratio.push(Math.round(eval(ratio*100))); | ||
//xvalue | ||
xvalue.push(i); | ||
i++; | ||
</#list> | ||
</#list> | ||
forchart(xvalue,ybandwidth,bandwidthname,bandwidthsp,id); | ||
forchart(xvalue,ythroughput,throughputname,throughputsp,id); | ||
forchart(xvalue,yRestime,avgResTimename,avgResTimesp,id); | ||
forchart(xvalue,yratio,rationame,ratiosp,id); | ||
} | ||
</#list> | ||
} | ||
</script> |
77 changes: 77 additions & 0 deletions
77
dev/cosbench-controller-web/WEB-INF/freemarker/forchart.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
<script type="text/javascript"> | ||
function forchart(xvalue,yvalue,name,sp,stagename){ | ||
require.config({ | ||
paths: { | ||
echarts: 'resources/build/dist' | ||
} | ||
}); | ||
require( | ||
[ | ||
'echarts', | ||
'echarts/chart/bar', | ||
'echarts/chart/line' | ||
], | ||
function (ec) { | ||
var myChart = ec.init(document.getElementById(name)); | ||
option = { | ||
title : { | ||
text: name+' '+'Graph', | ||
subtext: stagename | ||
}, | ||
tooltip : { | ||
trigger: 'axis' | ||
}, | ||
legend: { | ||
data:[name] | ||
}, | ||
toolbox: { | ||
show : true, | ||
feature : { | ||
mark : {show: true}, | ||
dataView : {show: true, readOnly: false}, | ||
magicType : {show: true, type: ['line', 'bar']}, | ||
restore : {show: true}, | ||
saveAsImage : {show: true} | ||
} | ||
}, | ||
calculable : true, | ||
xAxis : [ | ||
{ | ||
type : 'category', | ||
boundaryGap : false, | ||
data : xvalue | ||
} | ||
], | ||
yAxis : [ | ||
{ | ||
type : 'value', | ||
axisLabel : { | ||
formatter: '{value} '+sp | ||
} | ||
} | ||
], | ||
series : [ | ||
{ | ||
name:name, | ||
type:'line', | ||
data:yvalue, | ||
markPoint : { | ||
data : [ | ||
{type : 'max', name: 'max'}, | ||
{type : 'min', name: 'min'} | ||
] | ||
}, | ||
markLine : { | ||
data : [ | ||
{type : 'average', name: 'average'} | ||
] | ||
} | ||
} | ||
] | ||
}; | ||
myChart.setOption(option); | ||
} | ||
); | ||
} | ||
</script> |
61 changes: 61 additions & 0 deletions
61
dev/cosbench-controller-web/WEB-INF/freemarker/runningchart.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script type="text/javascript"> | ||
//bandwidth | ||
var ybandwidth=new Array(); | ||
var i=0; | ||
ybandwidth.push(0); | ||
var xvalue=new Array(); | ||
var bandwidthname="bandwidth"; | ||
var bandwidthsp="KB/S"; | ||
var bandwidth=""; | ||
//throughput | ||
var ythroughput=new Array(); | ||
ythroughput.push(0); | ||
var throughputname="throughput"; | ||
var throughputsp="op/s"; | ||
var throughput=""; | ||
//restime | ||
var yRestime=new Array(); | ||
yRestime.push(0); | ||
var avgResTime=""; | ||
var avgResTimename="resTime"; | ||
var avgResTimesp="ms"; | ||
//ratio | ||
var yratio=new Array(); | ||
yratio.push(0); | ||
var rationame="ratio"; | ||
var ratiosp="%"; | ||
var ratio=""; | ||
<#assign sInfo=info.currentStage> | ||
var stagename="${sInfo.id}"; | ||
<#list sInfo.snapshots as snapshot> | ||
<#list snapshot.report.allMetrics as mInfo> | ||
// bandwidth | ||
bandwidth="${mInfo.bandwidth}"; | ||
bandwidth=bandwidth.replace(/,/gi,''); | ||
ybandwidth.push(Math.round(eval(bandwidth/1024))); | ||
// throughput | ||
throughput="${mInfo.throughput}"; | ||
throughput=throughput.replace(/,/gi,''); | ||
ythroughput.push(Math.round(eval(throughput))); | ||
//resTime | ||
avgResTime="${mInfo.avgResTime}"; | ||
avgResTime=avgResTime.replace(/,/gi,''); | ||
yRestime.push(Math.round(eval(avgResTime))); | ||
//Succ-Ratio | ||
ratio="${mInfo.ratio}"; | ||
ratio=ratio.replace(/,/gi,''); | ||
yratio.push(Math.round(eval(ratio*100))); | ||
//xvalue | ||
var now = new Date(); | ||
xvalue.push(i); | ||
i++; | ||
</#list> | ||
</#list> | ||
forchart(xvalue,ybandwidth,bandwidthname,bandwidthsp,stagename); | ||
forchart(xvalue,ythroughput,throughputname,throughputsp,stagename); | ||
forchart(xvalue,yRestime,avgResTimename,avgResTimesp,stagename); | ||
forchart(xvalue,yratio,rationame,ratiosp,stagename); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.