View | Details | Raw Unified | Return to bug 60080
Collapse All | Expand All

(-)bin/report-template/content/js/dashboard-commons.js (+7 lines)
Lines 73-78 Link Here
73
    return "Elapsed Time (granularity: " + formatDuration(granularity) + ")";
73
    return "Elapsed Time (granularity: " + formatDuration(granularity) + ")";
74
}
74
}
75
75
76
/*
77
 * Gets axis label for the specified granularity
78
 */
79
function getConnectTimeLabel(granularity) {
80
    return "Connect Time (granularity: " + formatDuration(granularity) + ")";
81
}
82
76
//Get the property value of an object using the specified key
83
//Get the property value of an object using the specified key
77
//Returns the property value if all properties in the key exist; undefined
84
//Returns the property value if all properties in the key exist; undefined
78
//otherwise.
85
//otherwise.
(-)bin/report-template/content/js/graph.js.fmkr (-2 / +87 lines)
Lines 402-408 Link Here
402
                        return yval + " " + label;
402
                        return yval + " " + label;
403
                    }
403
                    }
404
                },
404
                },
405
                colors: ["green", "yellow", "orange", "red"]                
405
                colors: ["#9ACD32", "yellow", "orange", "#FF6347"]                
406
            };
406
            };
407
        },
407
        },
408
        createGraph: function() {
408
        createGraph: function() {
Lines 806-811 Link Here
806
    }
806
    }
807
};
807
};
808
808
809
var connectTimeOverTimeInfos = {
810
        data: ${connectTimeOverTime!"{}"},
811
        getOptions: function() {
812
            return {
813
                series: {
814
                    lines: {
815
                        show: true
816
                    },
817
                    points: {
818
                        show: true
819
                    }
820
                },
821
                xaxis: {
822
                    mode: "time",
823
                    timeformat: "%H:%M:%S",
824
                    axisLabel: getConnectTimeLabel(this.data.result.granularity),
825
                    axisLabelUseCanvas: true,
826
                    axisLabelFontSizePixels: 12,
827
                    axisLabelFontFamily: 'Verdana, Arial',
828
                    axisLabelPadding: 20,
829
                },
830
                yaxis: {
831
                    axisLabel: "Average Connect Time in ms",
832
                    axisLabelUseCanvas: true,
833
                    axisLabelFontSizePixels: 12,
834
                    axisLabelFontFamily: 'Verdana, Arial',
835
                    axisLabelPadding: 20,
836
                },
837
                legend: {
838
                    noColumns: 2,
839
                    show: true,
840
                    container: '#legendConnectTimeOverTime'
841
                },
842
                selection: {
843
                    mode: 'xy'
844
                },
845
                grid: {
846
                    hoverable: true // IMPORTANT! this is needed for tooltip to
847
                                    // work
848
                },
849
                tooltip: true,
850
                tooltipOpts: {
851
                    content: "%s : at %x Average connect time was %y ms"
852
                }
853
            };
854
        },
855
        createGraph: function () {
856
            var data = this.data;
857
            var dataset = prepareData(data.result.series, $("#choicesConnectTimeOverTime"));
858
            var options = this.getOptions();
859
            prepareOptions(options, data);
860
            $.plot($("#flotConnectTimeOverTime"), dataset, options);
861
            // setup overview
862
            $.plot($("#overviewConnectTimeOverTime"), dataset, prepareOverviewOptions(options));
863
        }
864
};
865
866
// Connect Time Over Time
867
function refreshConnectTimeOverTime(fixTimestamps) {
868
    var infos = connectTimeOverTimeInfos;
869
    prepareSeries(infos.data);
870
    if(fixTimestamps) {
871
        fixTimeStamps(infos.data.result.series, ${(timeZoneOffset?c)!0});
872
    }
873
    if(isGraph($("#flotConnectTimeOverTime"))) {
874
        infos.createGraph();
875
    }else {
876
        var choiceContainer = $("#choicesConnectTimeOverTime");
877
        createLegend(choiceContainer, infos);
878
        infos.createGraph();
879
        setGraphZoomable("#flotConnectTimeOverTime", "#overviewConnectTimeOverTime");
880
        $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){
881
            $(this).clone().prependTo(choiceContainer.find("li").eq(i));
882
        });
883
    }
884
};
885
809
var responseTimeVsRequestInfos = {
886
var responseTimeVsRequestInfos = {
810
    data: ${responseTimeVsRequest!"{}"},
887
    data: ${responseTimeVsRequest!"{}"},
811
    getOptions: function() {
888
    getOptions: function() {
Lines 1189-1199 Link Here
1189
                refreshBytesThroughputOverTime(true);
1266
                refreshBytesThroughputOverTime(true);
1190
            }
1267
            }
1191
            document.location.href="#responseTimesOverTime";
1268
            document.location.href="#responseTimesOverTime";
1192
        } else if (elem.id == "bodyLantenciesOverTime") {
1269
        } else if (elem.id == "bodyLatenciesOverTime") {
1193
            if (isGraph($(elem).find('.flot-chart-content')) == false) {
1270
            if (isGraph($(elem).find('.flot-chart-content')) == false) {
1194
                refreshLatenciesOverTime(true);
1271
                refreshLatenciesOverTime(true);
1195
            }
1272
            }
1196
            document.location.href="#latenciesOverTime";
1273
            document.location.href="#latenciesOverTime";
1274
        } else if (elem.id == "bodyConnectTimeOverTime") {
1275
            if (isGraph($(elem).find('.flot-chart-content')) == false) {
1276
                refreshConnectTimeOverTime(true);
1277
            }
1278
            document.location.href="#connectTimeOverTime";
1197
        } else if (elem.id == "bodyResponseTimeDistribution") {
1279
        } else if (elem.id == "bodyResponseTimeDistribution") {
1198
            if (isGraph($(elem).find('.flot-chart-content')) == false) {
1280
            if (isGraph($(elem).find('.flot-chart-content')) == false) {
1199
                refreshResponseTimeDistribution();
1281
                refreshResponseTimeDistribution();
Lines 1277-1282 Link Here
1277
    } else if ( id == "choicesLatenciesOverTime"){
1359
    } else if ( id == "choicesLatenciesOverTime"){
1278
        choiceContainer = $("#choicesLatenciesOverTime");
1360
        choiceContainer = $("#choicesLatenciesOverTime");
1279
        refreshLatenciesOverTime(false);
1361
        refreshLatenciesOverTime(false);
1362
    } else if ( id == "choicesConnectTimeOverTime"){
1363
        choiceContainer = $("#choicesConnectTimeOverTime");
1364
        refreshConnectTimeOverTime(false);
1280
    } else if ( id == "choicesResponseTimePercentiles"){
1365
    } else if ( id == "choicesResponseTimePercentiles"){
1281
        choiceContainer = $("#choicesResponseTimePercentiles");
1366
        choiceContainer = $("#choicesResponseTimePercentiles");
1282
        refreshResponseTimePercentiles();
1367
        refreshResponseTimePercentiles();
(-)bin/report-template/content/pages/OverTime.html.fmkr (-5 / +58 lines)
Lines 78-88 Link Here
78
                                            </a>
78
                                            </a>
79
                                        </li>
79
                                        </li>
80
                                        <li>
80
                                        <li>
81
                                            <a href="OverTime.html#latenciesOverTime" onclick="$('#bodyLantenciesOverTime').collapse('show');">
81
                                            <a href="OverTime.html#latenciesOverTime" onclick="$('#bodyLatenciesOverTime').collapse('show');">
82
                                                Latencies Over Time
82
                                                Latencies Over Time
83
                                            </a>
83
                                            </a>
84
                                        </li>
84
                                        </li>
85
85
                                        <li>
86
                                            <a href="OverTime.html#connectTimeOverTime" onclick="$('#bodyConnectTimeOverTime').collapse('show');">
87
                                                Connect Time Over Time
88
                                            </a>
89
                                        </li>
86
                                    </ul>
90
                                    </ul>
87
                                </li>
91
                                </li>
88
                                <li>
92
                                <li>
Lines 262-268 Link Here
262
                    <div class="panel panel-default">
266
                    <div class="panel panel-default">
263
                        <div class="panel-heading portlet-header">
267
                        <div class="panel-heading portlet-header">
264
                            <i class="fa fa-bar-chart-o fa-fw"></i>
268
                            <i class="fa fa-bar-chart-o fa-fw"></i>
265
                            <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>
269
                            <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>
266
                            <div class="pull-right">
270
                            <div class="pull-right">
267
                                <div class="btn-group">
271
                                <div class="btn-group">
268
                                    <a class="btn btn-link btn-xs">
272
                                    <a class="btn btn-link btn-xs">
Lines 278-291 Link Here
278
                                        </li>
282
                                        </li>
279
                                        <li><a href="#latenciesOverTime" onclick="exportToPNG('flotLatenciesOverTime', this);">Save as PNG</a></li>
283
                                        <li><a href="#latenciesOverTime" onclick="exportToPNG('flotLatenciesOverTime', this);">Save as PNG</a></li>
280
                                    </ul>
284
                                    </ul>
281
                                    <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyLantenciesOverTime" aria-expanded="true" aria-controls="bodyLantenciesOverTime">
285
                                    <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyLatenciesOverTime" aria-expanded="true" aria-controls="bodyLatenciesOverTime">
282
                                        <i class="fa fa-chevron-down"></i>
286
                                        <i class="fa fa-chevron-down"></i>
283
                                    </button>
287
                                    </button>
284
                                </div>
288
                                </div>
285
                            </div>
289
                            </div>
286
                        </div>
290
                        </div>
287
                        <!-- /.panel-heading -->
291
                        <!-- /.panel-heading -->
288
                        <div class="collapse out portlet-content" id="bodyLantenciesOverTime">
292
                        <div class="collapse out portlet-content" id="bodyLatenciesOverTime">
289
                            <div class="panel-body" id="collapseLatencies">
293
                            <div class="panel-body" id="collapseLatencies">
290
                                <div class="flot-chart">
294
                                <div class="flot-chart">
291
                                    <div class="flot-chart-content" id="flotLatenciesOverTime" style="float: left; width:80%;"></div>
295
                                    <div class="flot-chart-content" id="flotLatenciesOverTime" style="float: left; width:80%;"></div>
Lines 306-311 Link Here
306
                    <!-- /.panel -->
310
                    <!-- /.panel -->
307
                </div>
311
                </div>
308
312
313
                <!-- /.col-lg-6 -->
314
                <div class="col-lg-12 portlet" id="connectTimeOverTime">
315
                    <div class="panel panel-default">
316
                        <div class="panel-heading portlet-header">
317
                            <i class="fa fa-bar-chart-o fa-fw"></i>
318
                            <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>
319
                            <div class="pull-right">
320
                                <div class="btn-group">
321
                                    <a class="btn btn-link btn-xs">
322
                                        <i class="glyphicon glyphicon-resize-vertical"></i>
323
                                    </a>
324
                                    <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="dropdown">
325
                                        <i class="fa fa-wrench"></i>
326
                                    </button>
327
                                    <ul class="dropdown-menu dropdown-user">
328
                                        <li><a href="#connectTimeOverTime" onClick="checkAll('choicesConnectTimeOverTime');">Display all samples</a>
329
                                        </li>
330
                                        <li><a href="#connectTimeOverTime" onClick="uncheckAll('choicesConnectTimeOverTime');">Hide all samples</a>
331
                                        </li>
332
                                        <li><a href="#connectTimeOverTime" onclick="exportToPNG('flotConnectTimeOverTime', this);">Save as PNG</a></li>
333
                                    </ul>
334
                                    <button type="button" class="btn btn-link btn-xs dropdown-toggle" data-toggle="collapse" href="#bodyConnectTimeOverTime" aria-expanded="true" aria-controls="bodyConnectTimeOverTime">
335
                                        <i class="fa fa-chevron-down"></i>
336
                                    </button>
337
                                </div>
338
                            </div>
339
                        </div>
340
                        <!-- /.panel-heading -->
341
                        <div class="collapse out portlet-content" id="bodyConnectTimeOverTime">
342
                            <div class="panel-body" id="collapseConnectTime">
343
                                <div class="flot-chart">
344
                                    <div class="flot-chart-content" id="flotConnectTimeOverTime" style="float: left; width:80%;"></div>
345
                                    <div style="float:left;margin-left:5px">
346
                                        <p>Zoom :</p>
347
                                        <div id="overviewConnectTimeOverTime" style="width:190px;height:100px;"></div>
348
                                    </div>
349
                                </div>
350
                            </div>
351
                            <div class="panel-footer" id="footerConnectTimeOverTime">
352
                                    <p id="legendConnectTimeOverTime" hidden></p>
353
                                    <ul id="choicesConnectTimeOverTime" class="legend"></ul>
354
                            </div>
355
                        </div>
356
                        <!-- /.panel-body -->
357
358
                    </div>
359
                    <!-- /.panel -->
360
                </div>
361
                <!-- /.col-lg-6 -->
309
362
310
                <!-- /.col-lg-6 -->
363
                <!-- /.col-lg-6 -->
311
            </div>
364
            </div>
(-)bin/reportgenerator.properties (+5 lines)
Lines 100-105 Link Here
100
jmeter.reportgenerator.graph.latenciesOverTime.title=Latencies Over Time
100
jmeter.reportgenerator.graph.latenciesOverTime.title=Latencies Over Time
101
jmeter.reportgenerator.graph.latenciesOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
101
jmeter.reportgenerator.graph.latenciesOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
102
102
103
# Connect Time Over Time graph definition
104
jmeter.reportgenerator.graph.connectTimeOverTime.classname=org.apache.jmeter.report.processor.graph.impl.ConnectTimeOverTimeGraphConsumer
105
jmeter.reportgenerator.graph.connectTimeOverTime.title=Connect Time Over Time
106
jmeter.reportgenerator.graph.connectTimeOverTime.property.set_granularity=${jmeter.reportgenerator.overall_granularity}
107
103
# Response Time Vs Request graph definition
108
# Response Time Vs Request graph definition
104
jmeter.reportgenerator.graph.responseTimeVsRequest.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer
109
jmeter.reportgenerator.graph.responseTimeVsRequest.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimeVSRequestGraphConsumer
105
jmeter.reportgenerator.graph.responseTimeVsRequest.title=Response Time Vs Request
110
jmeter.reportgenerator.graph.responseTimeVsRequest.title=Response Time Vs Request
(-)src/core/org/apache/jmeter/report/core/Sample.java (+9 lines)
Lines 234-239 Link Here
234
    public long getLatency() {
234
    public long getLatency() {
235
        return getData(long.class, CSVSaveService.CSV_LATENCY).longValue();
235
        return getData(long.class, CSVSaveService.CSV_LATENCY).longValue();
236
    }
236
    }
237
    
238
    /**
239
     * Gets the connect time stored in the sample.
240
     *
241
     * @return the connect time stored in the sample
242
     */
243
    public long getConnectTime() {
244
        return getData(long.class, CSVSaveService.CSV_CONNECT_TIME).longValue();
245
    }
237
246
238
    /**
247
    /**
239
     * Gets the success status stored in the sample.
248
     * Gets the success status stored in the sample.
(-)src/core/org/apache/jmeter/report/processor/graph/ConnectTimeValueSelector.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *   http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 */
18
package org.apache.jmeter.report.processor.graph;
19
20
import org.apache.jmeter.report.core.Sample;
21
22
/**
23
 * The class ConnectTimeValueSelector provides a projection from a sample to its
24
 * connect time.
25
 *
26
 * @since 3.1
27
 */
28
public class ConnectTimeValueSelector implements GraphValueSelector {
29
    /*
30
     * (non-Javadoc)
31
     * 
32
     * @see
33
     * org.apache.jmeter.report.csv.processor.GraphValueSelector#select(java
34
     * .lang.String, java.lang.Object, org.apache.jmeter.report.csv.core.Sample)
35
     */
36
    @Override
37
    public double select(String series, Sample sample) {
38
        return sample.getConnectTime();
39
    }
40
41
}
(-)src/core/org/apache/jmeter/report/processor/graph/impl/ConnectTimeOverTimeGraphConsumer.java (+74 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *   http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 *
17
 */
18
package org.apache.jmeter.report.processor.graph.impl;
19
20
import java.util.Collections;
21
import java.util.HashMap;
22
import java.util.Map;
23
24
import org.apache.jmeter.report.processor.MeanAggregatorFactory;
25
import org.apache.jmeter.report.processor.graph.AbstractGraphConsumer;
26
import org.apache.jmeter.report.processor.graph.AbstractOverTimeGraphConsumer;
27
import org.apache.jmeter.report.processor.graph.ConnectTimeValueSelector;
28
import org.apache.jmeter.report.processor.graph.GroupInfo;
29
import org.apache.jmeter.report.processor.graph.NameSeriesSelector;
30
import org.apache.jmeter.report.processor.graph.TimeStampKeysSelector;
31
import org.apache.jmeter.util.JMeterUtils;
32
33
/**
34
 * The class ConnectTimeOverTimeGraphConsumer provides a graph to visualize Connection time
35
 * over time.
36
 *
37
 * @since 3.1
38
 */
39
public class ConnectTimeOverTimeGraphConsumer extends AbstractOverTimeGraphConsumer {
40
    private static final boolean CONNECT_TIME_SAVED =
41
            JMeterUtils.getPropDefault("jmeter.save.saveservice.connect_time", false); //$NON-NLS-1$
42
43
    /*
44
     * (non-Javadoc)
45
     * 
46
     * @see
47
     * org.apache.jmeter.report.csv.processor.impl.AbstractOverTimeGraphConsumer
48
     * #createTimeStampKeysSelector()
49
     */
50
    @Override
51
    protected TimeStampKeysSelector createTimeStampKeysSelector() {
52
        TimeStampKeysSelector keysSelector = new TimeStampKeysSelector();
53
        keysSelector.setSelectBeginTime(false);
54
        return keysSelector;
55
    }
56
57
    /*
58
     * (non-Javadoc)
59
     * 
60
     * @see org.apache.jmeter.report.csv.processor.impl.AbstractGraphConsumer#
61
     * createGroupInfos()
62
     */
63
    @Override
64
    protected Map<String, GroupInfo> createGroupInfos() {
65
        if(!CONNECT_TIME_SAVED) {
66
            return Collections.emptyMap();
67
        }
68
        HashMap<String, GroupInfo> groupInfos = new HashMap<>();
69
        groupInfos.put(AbstractGraphConsumer.DEFAULT_GROUP, new GroupInfo(
70
                new MeanAggregatorFactory(), new NameSeriesSelector(),
71
                new ConnectTimeValueSelector(), false, false));
72
        return groupInfos;
73
    }
74
}
(-)xdocs/usermanual/generating-dashboard.xml (+6 lines)
Lines 74-79 Link Here
74
jmeter.save.saveservice.thread_counts = true
74
jmeter.save.saveservice.thread_counts = true
75
jmeter.save.saveservice.thread_name = true
75
jmeter.save.saveservice.thread_name = true
76
jmeter.save.saveservice.time = true
76
jmeter.save.saveservice.time = true
77
jmeter.save.saveservice.connect_time = true
77
# the timestamp format must include the time and should include the date.
78
# the timestamp format must include the time and should include the date.
78
# For example the default, which is milliseconds since the epoch: 
79
# For example the default, which is milliseconds since the epoch: 
79
jmeter.save.saveservice.timestamp_format = ms
80
jmeter.save.saveservice.timestamp_format = ms
Lines 584-589 Link Here
584
                            <td>True</td>
585
                            <td>True</td>
585
                        </tr>
586
                        </tr>
586
                        <tr>
587
                        <tr>
588
                            <td>ConnectTimeOverTimeGraphConsumer</td>
589
                            <td>This graph represents the connection time over time.</td>
590
                            <td>True</td>
591
                        </tr>
592
                        <tr>
587
                            <td>LatencyVSRequestGraphConsumer</td>
593
                            <td>LatencyVSRequestGraphConsumer</td>
588
                            <td>This graph represents the median and average latency time
594
                            <td>This graph represents the median and average latency time
589
                                depending on the number of current requests.</td>
595
                                depending on the number of current requests.</td>

Return to bug 60080