2015-12-08 00:57:16 +08:00
|
|
|
/*
|
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
$(document).ready(function() {
|
2016-01-17 03:20:51 +08:00
|
|
|
|
|
|
|
|
$(".click-title").mouseenter( function( e){
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
this.style.cursor="pointer";
|
|
|
|
|
});
|
|
|
|
|
$(".click-title").mousedown( function(event){
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Ugly code while this script is shared among several pages
|
|
|
|
|
try{
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshHitsPerSecond(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
} catch(e){}
|
|
|
|
|
try{
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshResponseTimeOverTime(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
} catch(e){}
|
|
|
|
|
try{
|
|
|
|
|
refreshResponseTimePercentiles();
|
|
|
|
|
} catch(e){}
|
|
|
|
|
$(".portlet-header").css("cursor", "auto");
|
2015-12-08 00:57:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var showControllersOnly = ${showControllersOnly?c!"false"};
|
|
|
|
|
var seriesFilter = ${seriesFilter!"undefined"};
|
|
|
|
|
var filtersOnlySampleSeries = ${filtersOnlySampleSeries?c!"false"};
|
|
|
|
|
|
|
|
|
|
// Fixes time stamps
|
|
|
|
|
function fixTimeStamps(series, offset){
|
2016-01-17 03:20:51 +08:00
|
|
|
$.each(series, function(index, item) {
|
|
|
|
|
$.each(item.data, function(index, coord) {
|
|
|
|
|
coord[0] += offset;
|
|
|
|
|
});
|
|
|
|
|
});
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if the specified jquery object is a graph
|
|
|
|
|
function isGraph(object){
|
2016-01-17 03:20:51 +08:00
|
|
|
return object.data('plot') !== undefined;
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
2016-01-29 06:53:51 +08:00
|
|
|
/**
|
|
|
|
|
* Export graph to a PNG
|
|
|
|
|
*/
|
|
|
|
|
function exportToPNG(graphName, target) {
|
|
|
|
|
var plot = $("#"+graphName).data('plot');
|
|
|
|
|
var flotCanvas = plot.getCanvas();
|
|
|
|
|
var image = flotCanvas.toDataURL();
|
|
|
|
|
image = image.replace("image/png", "image/octet-stream");
|
|
|
|
|
|
|
|
|
|
var downloadAttrSupported = ("download" in document.createElement("a"));
|
|
|
|
|
if(downloadAttrSupported === true) {
|
|
|
|
|
target.download = graphName + ".png";
|
|
|
|
|
target.href = image;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
document.location.href = image;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
// Override the specified graph options to fit the requirements of an overview
|
|
|
|
|
function prepareOverviewOptions(graphOptions){
|
2016-01-17 03:20:51 +08:00
|
|
|
var overviewOptions = {
|
|
|
|
|
series: {
|
|
|
|
|
shadowSize: 0,
|
|
|
|
|
lines: {
|
|
|
|
|
lineWidth: 1
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
// Show points on overview only when linked graph does not show
|
|
|
|
|
// lines
|
2015-12-08 00:57:16 +08:00
|
|
|
show: getProperty('series.lines.show', graphOptions) == false,
|
|
|
|
|
radius : 1
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
ticks: 2,
|
|
|
|
|
axisLabel: null
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
ticks: 2,
|
|
|
|
|
axisLabel: null
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
show: false,
|
|
|
|
|
container: null
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
2015-12-08 00:57:16 +08:00
|
|
|
hoverable: false
|
|
|
|
|
},
|
|
|
|
|
tooltip: false
|
2016-01-17 03:20:51 +08:00
|
|
|
};
|
|
|
|
|
return $.extend(true, {}, graphOptions, overviewOptions);
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
2016-01-17 03:20:51 +08:00
|
|
|
// Force axes boundaries using graph extra options
|
2016-01-29 06:53:51 +08:00
|
|
|
function prepareOptions(options, data) {
|
|
|
|
|
options.canvas = true;
|
2016-01-17 03:20:51 +08:00
|
|
|
var extraOptions = data.extraOptions;
|
|
|
|
|
if(extraOptions !== undefined){
|
|
|
|
|
var xOffset = options.xaxis.mode === "time" ? ${(timeZoneOffset?c)!0} : 0;
|
|
|
|
|
var yOffset = options.yaxis.mode === "time" ? ${(timeZoneOffset?c)!0} : 0;
|
|
|
|
|
|
2016-02-08 19:50:41 +08:00
|
|
|
if(!isNaN(extraOptions.minX))
|
|
|
|
|
options.xaxis.min = parseFloat(extraOptions.minX) + xOffset;
|
|
|
|
|
|
|
|
|
|
if(!isNaN(extraOptions.maxX))
|
|
|
|
|
options.xaxis.max = parseFloat(extraOptions.maxX) + xOffset;
|
|
|
|
|
|
|
|
|
|
if(!isNaN(extraOptions.minY))
|
|
|
|
|
options.yaxis.min = parseFloat(extraOptions.minY) + yOffset;
|
|
|
|
|
|
|
|
|
|
if(!isNaN(extraOptions.maxY))
|
|
|
|
|
options.yaxis.max = parseFloat(extraOptions.maxY) + yOffset;
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Filter, mark series and sort data
|
2016-09-02 06:28:08 +08:00
|
|
|
/**
|
|
|
|
|
* @param data
|
|
|
|
|
* @param noMatchColor if defined and true, series.color are not matched with index
|
|
|
|
|
*/
|
|
|
|
|
function prepareSeries(data, noMatchColor){
|
2016-01-17 03:20:51 +08:00
|
|
|
var result = data.result;
|
|
|
|
|
|
|
|
|
|
// Keep only series when needed
|
|
|
|
|
if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){
|
|
|
|
|
// Insensitive case matching
|
|
|
|
|
var regexp = new RegExp(seriesFilter, 'i');
|
|
|
|
|
result.series = $.grep(result.series, function(series, index){
|
|
|
|
|
return regexp.test(series.label);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Keep only controllers series when supported and needed
|
|
|
|
|
if(result.supportsControllersDiscrimination && showControllersOnly){
|
|
|
|
|
result.series = $.grep(result.series, function(series, index){
|
|
|
|
|
return series.isController;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Sort data and mark series
|
|
|
|
|
$.each(result.series, function(index, series) {
|
|
|
|
|
series.data.sort(compareByXCoordinate);
|
2016-09-02 06:28:08 +08:00
|
|
|
if(!(noMatchColor && noMatchColor===true)) {
|
|
|
|
|
series.color = index;
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set the zoom on the specified plot object
|
|
|
|
|
function zoomPlot(plot, xmin, xmax, ymin, ymax){
|
2016-01-17 03:20:51 +08:00
|
|
|
var axes = plot.getAxes();
|
|
|
|
|
// Override axes min and max options
|
|
|
|
|
$.extend(true, axes, {
|
|
|
|
|
xaxis: {
|
|
|
|
|
options : { min: xmin, max: xmax }
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
options : { min: ymin, max: ymax }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Redraw the plot
|
|
|
|
|
plot.setupGrid();
|
|
|
|
|
plot.draw();
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Prepares DOM items to add zoom function on the specified graph
|
|
|
|
|
function setGraphZoomable(graphSelector, overviewSelector){
|
2016-01-17 03:20:51 +08:00
|
|
|
var graph = $(graphSelector);
|
|
|
|
|
var overview = $(overviewSelector);
|
|
|
|
|
|
|
|
|
|
// Ignore mouse down event
|
|
|
|
|
graph.bind("mousedown", function() { return false; });
|
|
|
|
|
overview.bind("mousedown", function() { return false; });
|
|
|
|
|
|
|
|
|
|
// Zoom on selection
|
|
|
|
|
graph.bind("plotselected", function (event, ranges) {
|
|
|
|
|
// clamp the zooming to prevent infinite zoom
|
|
|
|
|
if (ranges.xaxis.to - ranges.xaxis.from < 0.00001) {
|
|
|
|
|
ranges.xaxis.to = ranges.xaxis.from + 0.00001;
|
|
|
|
|
}
|
|
|
|
|
if (ranges.yaxis.to - ranges.yaxis.from < 0.00001) {
|
|
|
|
|
ranges.yaxis.to = ranges.yaxis.from + 0.00001;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Do the zooming
|
|
|
|
|
var plot = graph.data('plot');
|
|
|
|
|
zoomPlot(plot, ranges.xaxis.from, ranges.xaxis.to, ranges.yaxis.from, ranges.yaxis.to);
|
|
|
|
|
plot.clearSelection();
|
|
|
|
|
|
|
|
|
|
// Synchronize overview selection
|
|
|
|
|
overview.data('plot').setSelection(ranges, true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Zoom linked graph on overview selection
|
|
|
|
|
overview.bind("plotselected", function (event, ranges) {
|
|
|
|
|
graph.data('plot').setSelection(ranges);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Reset linked graph zoom when reseting overview selection
|
|
|
|
|
overview.bind("plotunselected", function () {
|
|
|
|
|
var overviewAxes = overview.data('plot').getAxes();
|
|
|
|
|
zoomPlot(graph.data('plot'), overviewAxes.xaxis.min, overviewAxes.xaxis.max, overviewAxes.yaxis.min, overviewAxes.yaxis.max);
|
|
|
|
|
});
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var responseTimePercentilesInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${responseTimePercentiles!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
points: { show: false }
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendResponseTimePercentiles'
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
tickDecimals: 1,
|
|
|
|
|
axisLabel: "Percentiles",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Percentile value in ms",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : %x.2 percentile was %y ms"
|
2016-01-17 03:20:51 +08:00
|
|
|
},
|
|
|
|
|
selection: { mode: "xy" },
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
2016-09-10 21:20:02 +08:00
|
|
|
var dataset = prepareData(data.result.series, $("#choicesResponseTimePercentiles"));
|
2016-01-17 03:20:51 +08:00
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotResponseTimesPercentiles"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewResponseTimesPercentiles"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
2016-01-17 03:20:51 +08:00
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
// Response times percentiles
|
|
|
|
|
function refreshResponseTimePercentiles() {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = responseTimePercentilesInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if (isGraph($("#flotResponseTimesPercentiles"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
} else {
|
|
|
|
|
var choiceContainer = $("#choicesResponseTimePercentiles");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotResponseTimesPercentiles", "#overviewResponseTimesPercentiles");
|
|
|
|
|
$('#bodyResponseTimePercentiles .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var responseTimeDistributionInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${responseTimeDistribution!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
var granularity = this.data.result.granularity;
|
|
|
|
|
return {
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendResponseTimeDistribution'
|
|
|
|
|
},
|
|
|
|
|
xaxis:{
|
|
|
|
|
axisLabel: "Response times in ms",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of responses",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
bars : {
|
|
|
|
|
show: true,
|
|
|
|
|
barWidth: this.data.result.granularity
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
|
|
|
|
content: function(label, xval, yval, flotItem){
|
|
|
|
|
return yval + " responses for " + label + " were between " + xval + " and " + (xval + granularity) + " ms";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotResponseTimeDistribution"), prepareData(data.result.series, $("#choicesResponseTimeDistribution")), options);
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Response time distribution
|
|
|
|
|
function refreshResponseTimeDistribution() {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = responseTimeDistributionInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if (isGraph($("#flotResponseTimeDistribution"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesResponseTimeDistribution");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
$('#footerResponseTimeDistribution .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
2016-09-02 06:28:08 +08:00
|
|
|
|
|
|
|
|
var syntheticResponseTimeDistributionInfos = {
|
|
|
|
|
data: ${syntheticResponseTimeDistribution!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendSyntheticResponseTimeDistribution'
|
|
|
|
|
},
|
|
|
|
|
xaxis:{
|
|
|
|
|
axisLabel: "Response times ranges",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
tickLength:0,
|
2016-09-03 04:53:14 +08:00
|
|
|
min:-0.5,
|
|
|
|
|
max:3.5
|
2016-09-02 06:28:08 +08:00
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of responses",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
bars : {
|
|
|
|
|
show: true,
|
|
|
|
|
align: "center",
|
2016-09-03 04:53:14 +08:00
|
|
|
barWidth: 0.25,
|
2016-09-02 06:28:08 +08:00
|
|
|
fill:.75
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
|
|
|
|
content: function(label, xval, yval, flotItem){
|
|
|
|
|
return yval + " " + label;
|
|
|
|
|
}
|
|
|
|
|
},
|
2016-09-03 04:15:47 +08:00
|
|
|
colors: ["#9ACD32", "yellow", "orange", "#FF6347"]
|
2016-09-02 06:28:08 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
options.xaxis.ticks = data.result.ticks;
|
|
|
|
|
$.plot($("#flotSyntheticResponseTimeDistribution"), prepareData(data.result.series, $("#choicesSyntheticResponseTimeDistribution")), options);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Response time distribution
|
|
|
|
|
function refreshSyntheticResponseTimeDistribution() {
|
|
|
|
|
var infos = syntheticResponseTimeDistributionInfos;
|
|
|
|
|
prepareSeries(infos.data, true);
|
|
|
|
|
if (isGraph($("#flotSyntheticResponseTimeDistribution"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesSyntheticResponseTimeDistribution");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
$('#footerSyntheticResponseTimeDistribution .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
var activeThreadsOverTimeInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${activeThreadsOverTime!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of active threads",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 6,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendActiveThreadsOverTime'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : At %x there were %y active threads"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesActiveThreadsOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotActiveThreadsOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewActiveThreadsOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Active Threads Over Time
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshActiveThreadsOverTime(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = activeThreadsOverTimeInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if(isGraph($("#flotActiveThreadsOverTime"))) {
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesActiveThreadsOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotActiveThreadsOverTime", "#overviewActiveThreadsOverTime");
|
|
|
|
|
$('#footerActiveThreadsOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var timeVsThreadsInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${timeVsThreads!"{}"},
|
2015-12-08 00:57:16 +08:00
|
|
|
getOptions: function() {
|
2016-01-17 03:20:51 +08:00
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
axisLabel: "Number of active threads",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Average response times in ms",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20
|
|
|
|
|
},
|
|
|
|
|
legend: { noColumns: 2,show: true, container: '#legendTimeVsThreads' },
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s: At %x.2 active threads, Average response time was %y.2 ms"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
2015-12-08 00:57:16 +08:00
|
|
|
},
|
2016-01-17 03:20:51 +08:00
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesTimeVsThreads"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotTimesVsThreads"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewTimesVsThreads"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Time vs threads
|
|
|
|
|
function refreshTimeVsThreads(){
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = timeVsThreadsInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if(isGraph($("#flotTimesVsThreads"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesTimeVsThreads");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotTimesVsThreads", "#overviewTimesVsThreads");
|
|
|
|
|
$('#footerTimeVsThreads .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var bytesThroughputOverTimeInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data : ${bytesThroughputOverTime!"{}"},
|
|
|
|
|
getOptions : function(){
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity) ,
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Bytes/sec",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendBytesThroughputOverTime'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: "xy"
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s at %x was %y"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph : function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesBytesThroughputOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotBytesThroughputOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewBytesThroughputOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Bytes throughput Over Time
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshBytesThroughputOverTime(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = bytesThroughputOverTimeInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if(isGraph($("#flotBytesThroughputOverTime"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesBytesThroughputOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotBytesThroughputOverTime", "#overviewBytesThroughputOverTime");
|
|
|
|
|
$('#footerBytesThroughputOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var responseTimesOverTimeInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${responseTimesOverTime!"{}"},
|
|
|
|
|
getOptions: function(){
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
2016-09-07 02:46:27 +08:00
|
|
|
axisLabel: "Response time in ms",
|
2016-01-17 03:20:51 +08:00
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendResponseTimesOverTime'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : at %x Average response time was %y ms"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesResponseTimesOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotResponseTimesOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewResponseTimesOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Response Times Over Time
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshResponseTimeOverTime(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = responseTimesOverTimeInfos;
|
2015-12-08 00:57:16 +08:00
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if(isGraph($("#flotResponseTimesOverTime"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesResponseTimesOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotResponseTimesOverTime", "#overviewResponseTimesOverTime");
|
|
|
|
|
$('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var latenciesOverTimeInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${latenciesOverTime!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
2016-09-07 02:46:27 +08:00
|
|
|
axisLabel: "Response latencies in ms",
|
2016-01-17 03:20:51 +08:00
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendLatenciesOverTime'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : at %x Average latency was %y ms"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function () {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesLatenciesOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotLatenciesOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewLatenciesOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Latencies Over Time
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshLatenciesOverTime(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = latenciesOverTimeInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if(isGraph($("#flotLatenciesOverTime"))) {
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else {
|
|
|
|
|
var choiceContainer = $("#choicesLatenciesOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotLatenciesOverTime", "#overviewLatenciesOverTime");
|
|
|
|
|
$('#footerLatenciesOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
2016-09-03 04:15:47 +08:00
|
|
|
var connectTimeOverTimeInfos = {
|
|
|
|
|
data: ${connectTimeOverTime!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getConnectTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Average Connect Time in ms",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendConnectTimeOverTime'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
|
|
|
|
content: "%s : at %x Average connect time was %y ms"
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function () {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesConnectTimeOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotConnectTimeOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewConnectTimeOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Connect Time Over Time
|
|
|
|
|
function refreshConnectTimeOverTime(fixTimestamps) {
|
|
|
|
|
var infos = connectTimeOverTimeInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
|
|
|
|
if(isGraph($("#flotConnectTimeOverTime"))) {
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else {
|
|
|
|
|
var choiceContainer = $("#choicesConnectTimeOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotConnectTimeOverTime", "#overviewConnectTimeOverTime");
|
|
|
|
|
$('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2016-09-07 02:46:27 +08:00
|
|
|
var responseTimePercentilesOverTimeInfos = {
|
|
|
|
|
data: ${responseTimePercentilesOverTime!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true,
|
|
|
|
|
fill: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Response Time in ms",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendResponseTimePercentilesOverTime'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
|
|
|
|
content: "%s : at %x Response time was %y ms"
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function () {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesResponseTimePercentilesOverTime"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotResponseTimePercentilesOverTime"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewResponseTimePercentilesOverTime"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Response Time Percentiles Over Time
|
|
|
|
|
function refreshResponseTimePercentilesOverTime(fixTimestamps) {
|
|
|
|
|
var infos = responseTimePercentilesOverTimeInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
|
|
|
|
if(isGraph($("#flotResponseTimePercentilesOverTime"))) {
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else {
|
|
|
|
|
var choiceContainer = $("#choicesResponseTimePercentilesOverTime");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotResponseTimePercentilesOverTime", "#overviewResponseTimePercentilesOverTime");
|
|
|
|
|
$('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
var responseTimeVsRequestInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${responseTimeVsRequest!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
axisLabel: "Global number of requests per second",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
2016-04-15 21:29:12 +08:00
|
|
|
axisLabel: "Median Response Time (ms)",
|
2016-01-17 03:20:51 +08:00
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: '#legendResponseTimeVsRequest'
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : Median response time at %x req/s was %y ms"
|
2016-09-10 17:41:31 +08:00
|
|
|
},
|
|
|
|
|
colors: ["#9ACD32", "#FF6347"]
|
2016-01-17 03:20:51 +08:00
|
|
|
};
|
|
|
|
|
},
|
2015-12-08 00:57:16 +08:00
|
|
|
createGraph: function () {
|
2016-01-17 03:20:51 +08:00
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesResponseTimeVsRequest"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotResponseTimeVsRequest"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewResponseTimeVsRequest"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Response Time vs Request
|
|
|
|
|
function refreshResponseTimeVsRequest() {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = responseTimeVsRequestInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if (isGraph($("#flotResponseTimeVsRequest"))){
|
|
|
|
|
infos.create();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesResponseTimeVsRequest");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotResponseTimeVsRequest", "#overviewResponseTimeVsRequest");
|
|
|
|
|
$('#footerResponseRimeVsRequest .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var latenciesVsRequestInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${latencyVsRequest!"{}"},
|
2015-12-08 00:57:16 +08:00
|
|
|
getOptions: function() {
|
2016-01-17 03:20:51 +08:00
|
|
|
return{
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
axisLabel: "Global number of requests per second",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
2016-04-15 21:29:12 +08:00
|
|
|
axisLabel: "Median Latency (ms)",
|
2016-01-17 03:20:51 +08:00
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: { noColumns: 2,show: true, container: '#legendLatencyVsRequest' },
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s : Median response time at %x req/s was %y ms"
|
2016-09-10 17:41:31 +08:00
|
|
|
},
|
|
|
|
|
colors: ["#9ACD32", "#FF6347"]
|
2016-01-17 03:20:51 +08:00
|
|
|
};
|
2015-12-08 00:57:16 +08:00
|
|
|
},
|
2016-01-17 03:20:51 +08:00
|
|
|
createGraph: function () {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesLatencyVsRequest"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotLatenciesVsRequest"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewLatenciesVsRequest"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Latencies vs Request
|
|
|
|
|
function refreshLatenciesVsRequest() {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = latenciesVsRequestInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
|
|
|
|
if(isGraph($("#flotLatenciesVsRequest"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesLatencyVsRequest");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotLatenciesVsRequest", "#overviewLatenciesVsRequest");
|
|
|
|
|
$('#footerLatenciesVsRequest .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var hitsPerSecondInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${hitsPerSecond!"{}"},
|
|
|
|
|
getOptions: function() {
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of hits / sec",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: "#legendHitsPerSecond"
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode : 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s at %x was %y.2 hits/sec"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function createGraph() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesHitsPerSecond"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotHitsPerSecond"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewHitsPerSecond"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Hits per second
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshHitsPerSecond(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = hitsPerSecondInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if (isGraph($("#flotHitsPerSecond"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesHitsPerSecond");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotHitsPerSecond", "#overviewHitsPerSecond");
|
|
|
|
|
$('#footerHitsPerSecond .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var codesPerSecondInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${codesPerSecond!"{}"},
|
|
|
|
|
getOptions: function(){
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of responses/sec",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: "#legendCodesPerSecond"
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "Number of Response Codes %s at %x was %y.2 responses / sec"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function() {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesCodesPerSecond"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotCodesPerSecond"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewCodesPerSecond"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Codes per second
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshCodesPerSecond(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = codesPerSecondInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2016-01-17 03:20:51 +08:00
|
|
|
if(isGraph($("#flotCodesPerSecond"))){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesCodesPerSecond");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotCodesPerSecond", "#overviewCodesPerSecond");
|
|
|
|
|
$('#footerCodesPerSecond .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var transactionsPerSecondInfos = {
|
2016-01-17 03:20:51 +08:00
|
|
|
data: ${transactionsPerSecond!"{}"},
|
|
|
|
|
getOptions: function(){
|
|
|
|
|
return {
|
|
|
|
|
series: {
|
|
|
|
|
lines: {
|
|
|
|
|
show: true
|
|
|
|
|
},
|
|
|
|
|
points: {
|
|
|
|
|
show: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xaxis: {
|
|
|
|
|
mode: "time",
|
|
|
|
|
timeformat: "%H:%M:%S",
|
|
|
|
|
axisLabel: getElapsedTimeLabel(this.data.result.granularity),
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20,
|
|
|
|
|
},
|
|
|
|
|
yaxis: {
|
|
|
|
|
axisLabel: "Number of transactions / sec",
|
|
|
|
|
axisLabelUseCanvas: true,
|
|
|
|
|
axisLabelFontSizePixels: 12,
|
|
|
|
|
axisLabelFontFamily: 'Verdana, Arial',
|
|
|
|
|
axisLabelPadding: 20
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
noColumns: 2,
|
|
|
|
|
show: true,
|
|
|
|
|
container: "#legendTransactionsPerSecond"
|
|
|
|
|
},
|
|
|
|
|
selection: {
|
|
|
|
|
mode: 'xy'
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
hoverable: true // IMPORTANT! this is needed for tooltip to
|
|
|
|
|
// work
|
|
|
|
|
},
|
|
|
|
|
tooltip: true,
|
|
|
|
|
tooltipOpts: {
|
2016-04-15 21:29:12 +08:00
|
|
|
content: "%s at %x was %y transactions / sec"
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
createGraph: function () {
|
|
|
|
|
var data = this.data;
|
|
|
|
|
var dataset = prepareData(data.result.series, $("#choicesTransactionsPerSecond"));
|
|
|
|
|
var options = this.getOptions();
|
|
|
|
|
prepareOptions(options, data);
|
|
|
|
|
$.plot($("#flotTransactionsPerSecond"), dataset, options);
|
|
|
|
|
// setup overview
|
|
|
|
|
$.plot($("#overviewTransactionsPerSecond"), dataset, prepareOverviewOptions(options));
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Transactions per second
|
2016-04-15 21:01:24 +08:00
|
|
|
function refreshTransactionsPerSecond(fixTimestamps) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var infos = transactionsPerSecondInfos;
|
|
|
|
|
prepareSeries(infos.data);
|
2016-04-15 21:01:24 +08:00
|
|
|
if(fixTimestamps) {
|
|
|
|
|
fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
if(isGraph($("#flotTransactionsPerSecond"))){
|
2016-01-17 03:20:51 +08:00
|
|
|
infos.createGraph();
|
|
|
|
|
}else{
|
|
|
|
|
var choiceContainer = $("#choicesTransactionsPerSecond");
|
|
|
|
|
createLegend(choiceContainer, infos);
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
setGraphZoomable("#flotTransactionsPerSecond", "#overviewTransactionsPerSecond");
|
|
|
|
|
$('#footerTransactionsPerSecond .legendColorBox > div').each(function(i){
|
|
|
|
|
$(this).clone().prependTo(choiceContainer.find("li").eq(i));
|
|
|
|
|
});
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Collapse the graph matching the specified DOM element depending the collapsed
|
|
|
|
|
// status
|
|
|
|
|
function collapse(elem, collapsed){
|
2016-01-17 03:20:51 +08:00
|
|
|
if(collapsed){
|
|
|
|
|
$(elem).parent().find(".fa-chevron-up").removeClass("fa-chevron-up").addClass("fa-chevron-down");
|
|
|
|
|
} else {
|
|
|
|
|
$(elem).parent().find(".fa-chevron-down").removeClass("fa-chevron-down").addClass("fa-chevron-up");
|
2016-01-26 05:18:02 +08:00
|
|
|
if (elem.id == "bodyBytesThroughputOverTime") {
|
2016-01-17 03:20:51 +08:00
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshBytesThroughputOverTime(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
2016-09-15 05:28:18 +08:00
|
|
|
document.location.href="#bytesThroughputOverTime";
|
2016-09-03 04:15:47 +08:00
|
|
|
} else if (elem.id == "bodyLatenciesOverTime") {
|
2016-01-17 03:20:51 +08:00
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshLatenciesOverTime(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
document.location.href="#latenciesOverTime";
|
2016-09-03 04:15:47 +08:00
|
|
|
} else if (elem.id == "bodyConnectTimeOverTime") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshConnectTimeOverTime(true);
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#connectTimeOverTime";
|
2016-09-07 02:46:27 +08:00
|
|
|
} else if (elem.id == "bodyResponseTimePercentilesOverTime") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshResponseTimePercentilesOverTime(true);
|
|
|
|
|
}
|
2016-09-15 05:28:18 +08:00
|
|
|
document.location.href="#responseTimePercentilesOverTime";
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if (elem.id == "bodyResponseTimeDistribution") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshResponseTimeDistribution();
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#responseTimeDistribution" ;
|
2016-09-02 06:28:08 +08:00
|
|
|
} else if (elem.id == "bodySyntheticResponseTimeDistribution") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshSyntheticResponseTimeDistribution();
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#syntheticResponseTimeDistribution" ;
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if (elem.id == "bodyActiveThreadsOverTime") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshActiveThreadsOverTime(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
document.location.href="#activeThreadsOverTime";
|
|
|
|
|
} else if (elem.id == "bodyTimeVsThreads") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshTimeVsThreads();
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#timeVsThreads" ;
|
|
|
|
|
} else if (elem.id == "bodyCodesPerSecond") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshCodesPerSecond(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
document.location.href="#codesPerSecond";
|
|
|
|
|
} else if (elem.id == "bodyTransactionsPerSecond") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshTransactionsPerSecond(true);
|
2016-01-17 03:20:51 +08:00
|
|
|
}
|
|
|
|
|
document.location.href="#transactionsPerSecond";
|
|
|
|
|
} else if (elem.id == "bodyResponseTimeVsRequest") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshResponseTimeVsRequest();
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#responseTimeVsRequest";
|
|
|
|
|
} else if (elem.id == "bodyLatenciesVsRequest") {
|
|
|
|
|
if (isGraph($(elem).find('.flot-chart-content')) == false) {
|
|
|
|
|
refreshLatenciesVsRequest();
|
|
|
|
|
}
|
|
|
|
|
document.location.href="#latencyVsRequest";
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Collapse
|
|
|
|
|
$(function() {
|
2016-01-17 03:20:51 +08:00
|
|
|
$('.collapse').on('shown.bs.collapse', function(){
|
|
|
|
|
collapse(this, false);
|
|
|
|
|
}).on('hidden.bs.collapse', function(){
|
|
|
|
|
collapse(this, true);
|
|
|
|
|
});
|
2015-12-08 00:57:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(function() {
|
2016-01-17 03:20:51 +08:00
|
|
|
$(".glyphicon").mousedown( function(event){
|
|
|
|
|
var tmp = $('.in:not(ul)');
|
|
|
|
|
tmp.parent().parent().parent().find(".fa-chevron-up").removeClass("fa-chevron-down").addClass("fa-chevron-down");
|
|
|
|
|
tmp.removeClass("in");
|
|
|
|
|
tmp.addClass("out");
|
|
|
|
|
});
|
2015-12-08 00:57:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Activates or deactivates all series of the specified graph (represented by id parameter)
|
2016-01-17 03:20:51 +08:00
|
|
|
* depending on checked argument.
|
2015-12-08 00:57:16 +08:00
|
|
|
*/
|
|
|
|
|
function toggleAll(id, checked){
|
2016-01-17 03:20:51 +08:00
|
|
|
var placeholder = document.getElementById(id);
|
|
|
|
|
|
|
|
|
|
var cases = $(placeholder).find(':checkbox');
|
2016-04-03 05:38:39 +08:00
|
|
|
cases.prop('checked', checked);
|
2016-01-17 03:20:51 +08:00
|
|
|
$(cases).parent().children().children().toggleClass("legend-disabled", !checked);
|
|
|
|
|
|
|
|
|
|
var choiceContainer;
|
|
|
|
|
if ( id == "choicesBytesThroughputOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesBytesThroughputOverTime");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshBytesThroughputOverTime(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if(id == "choicesResponseTimesOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesResponseTimesOverTime");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshResponseTimeOverTime(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesLatenciesOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesLatenciesOverTime");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshLatenciesOverTime(false);
|
2016-09-03 04:15:47 +08:00
|
|
|
} else if ( id == "choicesConnectTimeOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesConnectTimeOverTime");
|
|
|
|
|
refreshConnectTimeOverTime(false);
|
2016-09-07 02:46:27 +08:00
|
|
|
} else if ( id == "responseTimePercentilesOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesResponseTimePercentilesOverTime");
|
|
|
|
|
refreshResponseTimePercentilesOverTime(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesResponseTimePercentiles"){
|
|
|
|
|
choiceContainer = $("#choicesResponseTimePercentiles");
|
|
|
|
|
refreshResponseTimePercentiles();
|
|
|
|
|
} else if(id == "choicesActiveThreadsOverTime"){
|
|
|
|
|
choiceContainer = $("#choicesActiveThreadsOverTime");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshActiveThreadsOverTime(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesTimeVsThreads"){
|
|
|
|
|
choiceContainer = $("#choicesTimeVsThreads");
|
|
|
|
|
refreshTimeVsThreads();
|
2016-09-02 06:28:08 +08:00
|
|
|
} else if ( id == "choicesSyntheticResponseTimeDistribution"){
|
|
|
|
|
choiceContainer = $("#choicesSyntheticResponseTimeDistribution");
|
|
|
|
|
refreshSyntheticResponseTimeDistribution();
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesResponseTimeDistribution"){
|
|
|
|
|
choiceContainer = $("#choicesResponseTimeDistribution");
|
|
|
|
|
refreshResponseTimeDistribution();
|
|
|
|
|
} else if ( id == "choicesHitsPerSecond"){
|
|
|
|
|
choiceContainer = $("#choicesHitsPerSecond");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshHitsPerSecond(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if(id == "choicesCodesPerSecond"){
|
|
|
|
|
choiceContainer = $("#choicesCodesPerSecond");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshCodesPerSecond(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesTransactionsPerSecond"){
|
|
|
|
|
choiceContainer = $("#choicesTransactionsPerSecond");
|
2016-04-15 21:01:24 +08:00
|
|
|
refreshTransactionsPerSecond(false);
|
2016-01-17 03:20:51 +08:00
|
|
|
} else if ( id == "choicesResponseTimeVsRequest"){
|
|
|
|
|
choiceContainer = $("#choicesResponseTimeVsRequest");
|
|
|
|
|
refreshResponseTimeVsRequest();
|
|
|
|
|
} else if ( id == "choicesLatencyVsRequest"){
|
|
|
|
|
choiceContainer = $("#choicesLatencyVsRequest");
|
|
|
|
|
refreshLatenciesVsRequest();
|
|
|
|
|
}
|
|
|
|
|
var color = checked ? "black" : "#818181";
|
|
|
|
|
choiceContainer.find("label").each(function(){
|
|
|
|
|
this.style.color = color;
|
|
|
|
|
});
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Unchecks all boxes for "Hide all samples" functionality
|
|
|
|
|
function uncheckAll(id){
|
2016-01-17 03:20:51 +08:00
|
|
|
toggleAll(id, false);
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Checks all boxes for "Show all samples" functionality
|
|
|
|
|
function checkAll(id){
|
2016-01-17 03:20:51 +08:00
|
|
|
toggleAll(id, true);
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Prepares data to be consumed by plot plugins
|
|
|
|
|
function prepareData(series, choiceContainer, customizeSeries){
|
2016-01-17 03:20:51 +08:00
|
|
|
var datasets = [];
|
|
|
|
|
|
|
|
|
|
// Add only selected series to the data set
|
|
|
|
|
choiceContainer.find("input:checked").each(function (index, item) {
|
|
|
|
|
var key = $(item).attr("name");
|
|
|
|
|
var i = 0;
|
|
|
|
|
var size = series.length;
|
|
|
|
|
while(i < size && series[i].label != key)
|
|
|
|
|
i++;
|
|
|
|
|
if(i < size){
|
|
|
|
|
var currentSeries = series[i];
|
|
|
|
|
datasets.push(currentSeries);
|
|
|
|
|
if(customizeSeries)
|
|
|
|
|
customizeSeries(currentSeries);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return datasets;
|
2015-12-08 00:57:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2016-01-17 03:20:51 +08:00
|
|
|
* Ignore case comparator
|
2015-12-08 00:57:16 +08:00
|
|
|
*/
|
|
|
|
|
function sortAlphaCaseless(a,b){
|
|
|
|
|
return a.toLowerCase() > b.toLowerCase() ? 1 : -1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Creates a legend in the specified element with graph information
|
|
|
|
|
*/
|
|
|
|
|
function createLegend(choiceContainer, infos) {
|
2016-01-17 03:20:51 +08:00
|
|
|
// Sort series by name
|
2015-12-08 00:57:16 +08:00
|
|
|
var keys = [];
|
|
|
|
|
$.each(infos.data.result.series, function(index, series){
|
2016-01-17 03:20:51 +08:00
|
|
|
keys.push(series.label);
|
2015-12-08 00:57:16 +08:00
|
|
|
});
|
|
|
|
|
keys.sort(sortAlphaCaseless);
|
2016-01-17 03:20:51 +08:00
|
|
|
|
2015-12-08 00:57:16 +08:00
|
|
|
// Create list of series with support of activation/deactivation
|
|
|
|
|
$.each(keys, function(index, key) {
|
2016-01-17 03:20:51 +08:00
|
|
|
var id = choiceContainer.attr('id') + index;
|
|
|
|
|
$('<li />')
|
|
|
|
|
.append($('<input id="' + id + '" name="' + key + '" type="checkbox" checked="checked" hidden />'))
|
|
|
|
|
.append($('<label />', { 'text': key , 'for': id }))
|
|
|
|
|
.appendTo(choiceContainer);
|
|
|
|
|
});
|
|
|
|
|
choiceContainer.find("label").click( function(){
|
|
|
|
|
if (this.style.color !== "rgb(129, 129, 129)" ){
|
|
|
|
|
this.style.color="#818181";
|
|
|
|
|
}else {
|
|
|
|
|
this.style.color="black";
|
|
|
|
|
}
|
|
|
|
|
$(this).parent().children().children().toggleClass("legend-disabled");
|
|
|
|
|
});
|
|
|
|
|
choiceContainer.find("label").mousedown( function(event){
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
choiceContainer.find("label").mouseenter(function(){
|
|
|
|
|
this.style.cursor="pointer";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Recreate graphe on series activation toggle
|
|
|
|
|
choiceContainer.find("input").click(function(){
|
|
|
|
|
infos.createGraph();
|
|
|
|
|
});
|
|
|
|
|
}
|