diff --git a/bin/report-template/content/js/dashboard-commons.js b/bin/report-template/content/js/dashboard-commons.js index 010ba22b17..91b661dd06 100644 --- a/bin/report-template/content/js/dashboard-commons.js +++ b/bin/report-template/content/js/dashboard-commons.js @@ -73,6 +73,13 @@ function getElapsedTimeLabel(granularity) { return "Elapsed Time (granularity: " + formatDuration(granularity) + ")"; } +/* + * Gets axis label for the specified granularity + */ +function getConnectTimeLabel(granularity) { + return "Connect Time (granularity: " + formatDuration(granularity) + ")"; +} + //Get the property value of an object using the specified key //Returns the property value if all properties in the key exist; undefined //otherwise. diff --git a/bin/report-template/content/js/graph.js.fmkr b/bin/report-template/content/js/graph.js.fmkr index f222803e5e..efda6acca8 100644 --- a/bin/report-template/content/js/graph.js.fmkr +++ b/bin/report-template/content/js/graph.js.fmkr @@ -402,7 +402,7 @@ var syntheticResponseTimeDistributionInfos = { return yval + " " + label; } }, - colors: ["green", "yellow", "orange", "red"] + colors: ["#9ACD32", "yellow", "orange", "#FF6347"] }; }, createGraph: function() { @@ -806,6 +806,83 @@ function refreshLatenciesOverTime(fixTimestamps) { } }; +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)); + }); + } +}; + var responseTimeVsRequestInfos = { data: ${responseTimeVsRequest!"{}"}, getOptions: function() { @@ -1189,11 +1266,16 @@ function collapse(elem, collapsed){ refreshBytesThroughputOverTime(true); } document.location.href="#responseTimesOverTime"; - } else if (elem.id == "bodyLantenciesOverTime") { + } else if (elem.id == "bodyLatenciesOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshLatenciesOverTime(true); } document.location.href="#latenciesOverTime"; + } else if (elem.id == "bodyConnectTimeOverTime") { + if (isGraph($(elem).find('.flot-chart-content')) == false) { + refreshConnectTimeOverTime(true); + } + document.location.href="#connectTimeOverTime"; } else if (elem.id == "bodyResponseTimeDistribution") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimeDistribution(); @@ -1277,6 +1359,9 @@ function toggleAll(id, checked){ } else if ( id == "choicesLatenciesOverTime"){ choiceContainer = $("#choicesLatenciesOverTime"); refreshLatenciesOverTime(false); + } else if ( id == "choicesConnectTimeOverTime"){ + choiceContainer = $("#choicesConnectTimeOverTime"); + refreshConnectTimeOverTime(false); } else if ( id == "choicesResponseTimePercentiles"){ choiceContainer = $("#choicesResponseTimePercentiles"); refreshResponseTimePercentiles(); diff --git a/bin/report-template/content/pages/OverTime.html.fmkr b/bin/report-template/content/pages/OverTime.html.fmkr index f189b7b4ca..9c752d516c 100644 --- a/bin/report-template/content/pages/OverTime.html.fmkr +++ b/bin/report-template/content/pages/OverTime.html.fmkr @@ -78,11 +78,15 @@
Zoom :
+ +