You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/09/02 20:15:47 UTC
svn commit: r1759031 - in /jmeter/trunk: bin/
bin/report-template/content/js/ bin/report-template/content/pages/
src/core/org/apache/jmeter/report/core/
src/core/org/apache/jmeter/report/processor/graph/
src/core/org/apache/jmeter/report/processor/grap...
Author: pmouawad
Date: Fri Sep 2 20:15:47 2016
New Revision: 1759031
URL: http://svn.apache.org/viewvc?rev=1759031&view=rev
Log:
Bug 60080 - Report / Dashboard : Add a new "Connect Time Over Time " graph
Contributed by UbikLoadPack
Bugzilla Id: 60080
Added:
jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java (with props)
jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java (with props)
Modified:
jmeter/trunk/bin/report-template/content/js/dashboard-commons.js
jmeter/trunk/bin/report-template/content/js/graph.js.fmkr
jmeter/trunk/bin/report-template/content/pages/OverTime.html.fmkr
jmeter/trunk/bin/reportgenerator.properties
jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
jmeter/trunk/xdocs/changes.xml
jmeter/trunk/xdocs/usermanual/generating-dashboard.xml
Modified: jmeter/trunk/bin/report-template/content/js/dashboard-commons.js
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/js/dashboard-commons.js?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/js/dashboard-commons.js (original)
+++ jmeter/trunk/bin/report-template/content/js/dashboard-commons.js Fri Sep 2 20:15:47 2016
@@ -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.
Modified: jmeter/trunk/bin/report-template/content/js/graph.js.fmkr
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/js/graph.js.fmkr?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/js/graph.js.fmkr (original)
+++ jmeter/trunk/bin/report-template/content/js/graph.js.fmkr Fri Sep 2 20:15:47 2016
@@ -402,7 +402,7 @@ var syntheticResponseTimeDistributionInf
return yval + " " + label;
}
},
- colors: ["green", "yellow", "orange", "red"]
+ colors: ["#9ACD32", "yellow", "orange", "#FF6347"]
};
},
createGraph: function() {
@@ -806,6 +806,83 @@ function refreshLatenciesOverTime(fixTim
}
};
+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();
Modified: jmeter/trunk/bin/report-template/content/pages/OverTime.html.fmkr
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/pages/OverTime.html.fmkr?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/pages/OverTime.html.fmkr (original)
+++ jmeter/trunk/bin/report-template/content/pages/OverTime.html.fmkr Fri Sep 2 20:15:47 2016
@@ -78,11 +78,15 @@
</a>
</li>
<li>
- <a href="OverTime.html#latenciesOverTime" onclick="$('#bodyLantenciesOverTime').collapse('show');">
+ <a href="OverTime.html#latenciesOverTime" onclick="$('#bodyLatenciesOverTime').collapse('show');">
Latencies Over Time
</a>
</li>
-
+ <li>
+ <a href="OverTime.html#connectTimeOverTime" onclick="$('#bodyConnectTimeOverTime').collapse('show');">
+ Connect Time Over Time
+ </a>
+ </li>
</ul>
</li>
<li>
@@ -262,7 +266,7 @@
<div class="panel panel-default">
<div class="panel-heading portlet-header">
<i class="fa fa-bar-chart-o fa-fw"></i>
- <span type="button" class="dropdown-toggle click-title span-title" data-toggle="collapse" href="#bodyLantenciesOverTime" aria-expanded="true" aria-controls="bodyLantenciesOverTime">Latencies Over Time</span>
+ <span type="button" class="dropdown-toggle click-title span-title" data-toggle="collapse" href="#bodyLatenciesOverTime" aria-expanded="true" aria-controls="bodyLatenciesOverTime">Latencies Over Time</span>
<div class="pull-right">
<div class="btn-group">
<a class="btn btn-link btn-xs">
@@ -278,14 +282,14 @@
</li>
<li><a href="#latenciesOverTime" onclick="exportToPNG('flotLatenciesOverTime', this);">Save as PNG</a></li>
</ul>
- <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyLantenciesOverTime" aria-expanded="true" aria-controls="bodyLantenciesOverTime">
+ <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyLatenciesOverTime" aria-expanded="true" aria-controls="bodyLatenciesOverTime">
<i class="fa fa-chevron-down"></i>
</button>
</div>
</div>
</div>
<!-- /.panel-heading -->
- <div class="collapse out portlet-content" id="bodyLantenciesOverTime">
+ <div class="collapse out portlet-content" id="bodyLatenciesOverTime">
<div class="panel-body" id="collapseLatencies">
<div class="flot-chart">
<div class="flot-chart-content" id="flotLatenciesOverTime" style="float: left; width:80%;"></div>
@@ -306,6 +310,55 @@
<!-- /.panel -->
</div>
+ <!-- /.col-lg-6 -->
+ <div class="col-lg-12 portlet" id="connectTimeOverTime">
+ <div class="panel panel-default">
+ <div class="panel-heading portlet-header">
+ <i class="fa fa-bar-chart-o fa-fw"></i>
+ <span type="button" class="dropdown-toggle click-title span-title" data-toggle="collapse" href="#bodyConnectTimeOverTime" aria-expanded="true" aria-controls="bodyConnectTimeOverTime">Connect Time Over Time</span>
+ <div class="pull-right">
+ <div class="btn-group">
+ <a class="btn btn-link btn-xs">
+ <i class="glyphicon glyphicon-resize-vertical"></i>
+ </a>
+ <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="dropdown">
+ <i class="fa fa-wrench"></i>
+ </button>
+ <ul class="dropdown-menu dropdown-user">
+ <li><a href="#connectTimeOverTime" onClick="checkAll('choicesConnectTimeOverTime');">Display all samples</a>
+ </li>
+ <li><a href="#connectTimeOverTime" onClick="uncheckAll('choicesConnectTimeOverTime');">Hide all samples</a>
+ </li>
+ <li><a href="#connectTimeOverTime" onclick="exportToPNG('flotConnectTimeOverTime', this);">Save as PNG</a></li>
+ </ul>
+ <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyConnectTimeOverTime" aria-expanded="true" aria-controls="bodyConnectTimeOverTime">
+ <i class="fa fa-chevron-down"></i>
+ </button>
+ </div>
+ </div>
+ </div>
+ <!-- /.panel-heading -->
+ <div class="collapse out portlet-content" id="bodyConnectTimeOverTime">
+ <div class="panel-body" id="collapseConnectTime">
+ <div class="flot-chart">
+ <div class="flot-chart-content" id="flotConnectTimeOverTime" style="float: left; width:80%;"></div>
+ <div style="float:left;margin-left:5px">
+ <p>Zoom :</p>
+ <div id="overviewConnectTimeOverTime" style="width:190px;height:100px;"></div>
+ </div>
+ </div>
+ </div>
+ <div class="panel-footer" id="footerConnectTimeOverTime">
+ <p id="legendConnectTimeOverTime" hidden></p>
+ <ul id="choicesConnectTimeOverTime" class="legend"></ul>
+ </div>
+ </div>
+ <!-- /.panel-body -->
+
+ </div>
+ <!-- /.panel -->
+ </div>
+ <!-- /.col-lg-6 -->
<!-- /.col-lg-6 -->
</div>
Modified: jmeter/trunk/bin/reportgenerator.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/reportgenerator.properties?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/bin/reportgenerator.properties (original)
+++ jmeter/trunk/bin/reportgenerator.properties Fri Sep 2 20:15:47 2016
@@ -100,6 +100,11 @@ jmeter.reportgenerator.graph.latenciesOv
jmeter.reportgenerator.graph.latenciesOverTime.title=Latencies Over Time
jmeter.reportgenerator.graph.latenciesOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
+# Connect Time Over Time graph definition
+jmeter.reportgenerator.graph.connectTimeOverTime.classname=org.apache.jmeter.report.processor.graph.impl.ConnectTimeOverTimeGraphConsumer
+jmeter.reportgenerator.graph.connectTimeOverTime.title=Connect Time Over Time
+jmeter.reportgenerator.graph.connectTimeOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
+
# Response Time Vs Request graph definition
jmeter.reportgenerator.graph.responseTimeVsRequest.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer
jmeter.reportgenerator.graph.responseTimeVsRequest.title=Response Time Vs Request
Modified: jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java Fri Sep 2 20:15:47 2016
@@ -234,6 +234,15 @@ public class Sample {
public long getLatency() {
return getData(long.class, CSVSaveService.CSV_LATENCY).longValue();
}
+
+ /**
+ * Gets the connect time stored in the sample.
+ *
+ * @return the connect time stored in the sample
+ */
+ public long getConnectTime() {
+ return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue();
+ }
/**
* Gets the success status stored in the sample.
Added: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java?rev=1759031&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java (added)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java Fri Sep 2 20:15:47 2016
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.jmeter.report.processor.graph;
+
+import org.apache.jmeter.report.core.Sample;
+
+/**
+ * The class ConnectTimeValueSelector provides a projection from a sample to its
+ * connect time.
+ *
+ * @since 3.1
+ */
+public class ConnectTimeValueSelector implements GraphValueSelector {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.csv.processor.GraphValueSelector#select(java
+ * .lang.String, java.lang.Object, org.apache.jmeter.report.csv.core.Sample)
+ */
+ @Override
+ public double select(String series, Sample sample) {
+ return sample.getConnectTime();
+ }
+
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java?rev=1759031&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java (added)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java Fri Sep 2 20:15:47 2016
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ *
+ */
+package org.apache.jmeter.report.processor.graph.impl;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jmeter.report.processor.MeanAggregatorFactory;
+import org.apache.jmeter.report.processor.graph.AbstractGraphConsumer;
+import org.apache.jmeter.report.processor.graph.AbstractOverTimeGraphConsumer;
+import org.apache.jmeter.report.processor.graph.ConnectTimeValueSelector;
+import org.apache.jmeter.report.processor.graph.GroupInfo;
+import org.apache.jmeter.report.processor.graph.NameSeriesSelector;
+import org.apache.jmeter.report.processor.graph.TimeStampKeysSelector;
+import org.apache.jmeter.util.JMeterUtils;
+
+/**
+ * The class ConnectTimeOverTimeGraphConsumer provides a graph to visualize Connection time
+ * over time.
+ *
+ * @since 3.1
+ */
+public class ConnectTimeOverTimeGraphConsumer extends AbstractOverTimeGraphConsumer {
+ private static final boolean CONNECT_TIME_SAVED =
+ JMeterUtils.getPropDefault("jmeter.save.saveservice.connect_time", false); //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.jmeter.report.csv.processor.impl.AbstractOverTimeGraphConsumer
+ * #createTimeStampKeysSelector()
+ */
+ @Override
+ protected TimeStampKeysSelector createTimeStampKeysSelector() {
+ TimeStampKeysSelector keysSelector = new TimeStampKeysSelector();
+ keysSelector.setSelectBeginTime(false);
+ return keysSelector;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.jmeter.report.csv.processor.impl.AbstractGraphConsumer#
+ * createGroupInfos()
+ */
+ @Override
+ protected Map<String, GroupInfo> createGroupInfos() {
+ if(!CONNECT_TIME_SAVED) {
+ return Collections.emptyMap();
+ }
+ HashMap<String, GroupInfo> groupInfos = new HashMap<>();
+ groupInfos.put(AbstractGraphConsumer.DEFAULT_GROUP, new GroupInfo(
+ new MeanAggregatorFactory(), new NameSeriesSelector(),
+ new ConnectTimeValueSelector(), false, false));
+ return groupInfos;
+ }
+}
Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri Sep 2 20:15:47 2016
@@ -137,6 +137,7 @@ Summary
<li><bug>59956</bug>Web Report / Dashboard : Add ability to generate a graph for a range of data</li>
<li><bug>60065</bug>Report / Dashboard : Improve Dashboard Error Summary by adding response message to "Type of error". Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
<li><bug>60079</bug>Report / Dashboard : Add a new "Response Time Overview" graph</li>
+ <li><bug>60080</bug>Report / Dashboard : Add a new "Connect Time Over Time " graph. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
</ul>
<ch_section>Non-functional changes</ch_section>
Modified: jmeter/trunk/xdocs/usermanual/generating-dashboard.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/generating-dashboard.xml?rev=1759031&r1=1759030&r2=1759031&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/generating-dashboard.xml (original)
+++ jmeter/trunk/xdocs/usermanual/generating-dashboard.xml Fri Sep 2 20:15:47 2016
@@ -74,6 +74,7 @@ jmeter.save.saveservice.successful = tru
jmeter.save.saveservice.thread_counts = true
jmeter.save.saveservice.thread_name = true
jmeter.save.saveservice.time = true
+jmeter.save.saveservice.connect_time = true
# the timestamp format must include the time and should include the date.
# For example the default, which is milliseconds since the epoch:
jmeter.save.saveservice.timestamp_format = ms
@@ -584,6 +585,11 @@ jmeter.reportgenerator.exporter.html.fil
<td>True</td>
</tr>
<tr>
+ <td>ConnectTimeOverTimeGraphConsumer</td>
+ <td>This graph represents the connection time over time.</td>
+ <td>True</td>
+ </tr>
+ <tr>
<td>LatencyVSRequestGraphConsumer</td>
<td>This graph represents the median and average latency time
depending on the number of current requests.</td>