jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1765870 - in /jmeter/trunk: bin/ bin/report-template/ bin/report-template/content/js/ src/core/org/apache/jmeter/report/config/ src/core/org/apache/jmeter/report/dashboard/ src/core/org/apache/jmeter/report/processor/ src/core/org/apache/j...
Date Thu, 20 Oct 2016 20:07:32 GMT
Author: pmouawad
Date: Thu Oct 20 20:07:31 2016
New Revision: 1765870

URL: http://svn.apache.org/viewvc?rev=1765870&view=rev
Log:
Bug 60287 - Report / Dashboard : Have a new Top5 Errors by sampler table in Dashboard
Bugzilla Id: 60287

Added:
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java
  (with props)
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java  
(with props)
Modified:
    jmeter/trunk/bin/report-template/content/js/dashboard.js.fmkr
    jmeter/trunk/bin/report-template/index.html.fmkr
    jmeter/trunk/bin/reportgenerator.properties
    jmeter/trunk/src/core/org/apache/jmeter/report/config/ReportGeneratorConfiguration.java
    jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java
    jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/generating-dashboard.xml

Modified: jmeter/trunk/bin/report-template/content/js/dashboard.js.fmkr
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/content/js/dashboard.js.fmkr?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/content/js/dashboard.js.fmkr (original)
+++ jmeter/trunk/bin/report-template/content/js/dashboard.js.fmkr Thu Oct 20 20:07:31 2016
@@ -64,10 +64,12 @@ function createTable(table, info, format
         if((!regexp || filtersOnlySampleSeries && !info.supportsControllersDiscrimination
|| regexp.test(item.data[seriesIndex]))
                 &&
                 (!showControllersOnly || !info.supportsControllersDiscrimination || item.isController)){
-            var newRow = tBody.insertRow(-1);
-            for(var col=0; col < item.data.length; col++){
-                var cell = newRow.insertCell(-1);
-                cell.innerHTML = formatter ? formatter(col, item.data[col]) : item.data[col];
+            if(item.data.length > 0) {
+                var newRow = tBody.insertRow(-1);
+                for(var col=0; col < item.data.length; col++){
+                    var cell = newRow.insertCell(-1);
+                    cell.innerHTML = formatter ? formatter(col, item.data[col]) : item.data[col];
+                }
             }
         }
     }
@@ -165,7 +167,7 @@ $(document).ready(function() {
         }
         return item;
     }, [[0, 0]], 0);
-
+    
     // Create error table
     createTable($("#errorsTable"), ${errorsSummary!"{}"}, function(index, item){
         switch(index){
@@ -176,4 +178,10 @@ $(document).ready(function() {
         }
         return item;
     }, [[1, 1]]);
+    
+        // Create top5 errors by sampler
+    createTable($("#top5ErrorsBySamplerTable"), ${top5ErrorsBySampler!"{}"}, function(index,
item){
+        return item;
+    }, [[0, 0]], 0);
+    
 });

Modified: jmeter/trunk/bin/report-template/index.html.fmkr
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/report-template/index.html.fmkr?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/bin/report-template/index.html.fmkr (original)
+++ jmeter/trunk/bin/report-template/index.html.fmkr Thu Oct 20 20:07:31 2016
@@ -159,6 +159,19 @@
                     </div>
                 </div>
             </div>
+            <div class="col-lg-12">
+                <div class="panel panel-default" style="text-align:center;">
+                    <div class="panel-heading">
+                        <p class="dashboard-title">Top 5 Errors by sampler</p>
+                    </div>
+                    <div class="panel-body">
+                        <section class="col-md-12 table-responsive">
+                            <table id="top5ErrorsBySamplerTable" class="table table-bordered
table-condensed tablesorter ">
+                            </table>
+                        </section>
+                    </div>
+                </div>
+            </div>
         </div>
     </div>
 

Modified: jmeter/trunk/bin/reportgenerator.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/reportgenerator.properties?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/bin/reportgenerator.properties (original)
+++ jmeter/trunk/bin/reportgenerator.properties Thu Oct 20 20:07:31 2016
@@ -63,6 +63,10 @@ jmeter.reportgenerator.apdex_tolerated_t
 # see Bug 60149
 jmeter.reportgenerator.overall_granularity=60000
 
+# Exclude transaction controller from analysis
+# true by default
+jmeter.reportgenerator.exclude_tc_from_top5_errors_by_sampler=true
+
 # Response Time Percentiles graph definition
 jmeter.reportgenerator.graph.responseTimePercentiles.classname=org.apache.jmeter.report.processor.graph.impl.ResponseTimePercentilesGraphConsumer
 jmeter.reportgenerator.graph.responseTimePercentiles.title=Response Time Percentiles

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/config/ReportGeneratorConfiguration.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/config/ReportGeneratorConfiguration.java?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/config/ReportGeneratorConfiguration.java
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/config/ReportGeneratorConfiguration.java
Thu Oct 20 20:07:31 2016
@@ -72,6 +72,10 @@ public class ReportGeneratorConfiguratio
             + KEY_DELIMITER + "apdex_tolerated_threshold";
     private static final Long REPORT_GENERATOR_KEY_APDEX_TOLERATED_THRESHOLD_DEFAULT = Long.valueOf(1500L);
 
+    // Exclude Transaction Controller from Top5 Errors by Sampler consumer
+    private static final String REPORT_GENERATOR_KEY_EXCLUDE_TC_FROM_TOP5_ERRORS_BY_SAMPLER
= REPORT_GENERATOR_KEY_PREFIX
+            + KEY_DELIMITER + "exclude_tc_from_top5_errors_by_sampler";
+
     // Sample Filter
     private static final String REPORT_GENERATOR_KEY_SAMPLE_FILTER = REPORT_GENERATOR_KEY_PREFIX
             + KEY_DELIMITER + "sample_filter";
@@ -285,6 +289,7 @@ public class ReportGeneratorConfiguratio
     private long apdexSatisfiedThreshold;
     private long apdexToleratedThreshold;
     private Pattern filteredSamplesPattern;
+    private boolean ignoreTCFromTop5ErrorsBySampler;
     private Map<String, ExporterConfiguration> exportConfigurations = new HashMap<>();
     private Map<String, GraphConfiguration> graphConfigurations = new HashMap<>();
 
@@ -624,6 +629,13 @@ public class ReportGeneratorConfiguratio
                 long.class).longValue();
         configuration.setApdexToleratedThreshold(apdexToleratedThreshold);
 
+        final boolean ignoreTCFromTop5ErrorsBySampler = getRequiredProperty(
+                props, 
+                REPORT_GENERATOR_KEY_EXCLUDE_TC_FROM_TOP5_ERRORS_BY_SAMPLER,
+                Boolean.TRUE,
+                Boolean.class).booleanValue();
+        configuration.setIgnoreTCFromTop5ErrorsBySampler(ignoreTCFromTop5ErrorsBySampler);
+        
         // Load sample filter
         final String sampleFilter = getOptionalProperty(props,
                 REPORT_GENERATOR_KEY_SAMPLE_FILTER, String.class);
@@ -748,4 +760,19 @@ public class ReportGeneratorConfiguratio
     public void setEndDate(Date endDate) {
         this.endDate = endDate;
     }
+
+    /**
+     * @return the ignoreTCFromTop5ErrorsBySampler
+     */
+    public boolean isIgnoreTCFromTop5ErrorsBySampler() {
+        return ignoreTCFromTop5ErrorsBySampler;
+    }
+
+    /**
+     * @param ignoreTCFromTop5ErrorsBySampler the ignoreTCFromTop5ErrorsBySampler to set
+     */
+    public void setIgnoreTCFromTop5ErrorsBySampler(
+            boolean ignoreTCFromTop5ErrorsBySampler) {
+        this.ignoreTCFromTop5ErrorsBySampler = ignoreTCFromTop5ErrorsBySampler;
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/HtmlTemplateExporter.java Thu
Oct 20 20:07:31 2016
@@ -418,6 +418,10 @@ public class HtmlTemplateExporter extend
         addResultToContext(ReportGenerator.STATISTICS_SUMMARY_CONSUMER_NAME,
                 storedData, dataContext, jsonizer);
 
+        // Add Top 5 errors by sampler consumer result to the data context
+        addResultToContext(ReportGenerator.TOP5_ERRORS_BY_SAMPLER_CONSUMER_NAME,
+                storedData, dataContext, jsonizer);
+
         // Collect graph results from sample context and transform them into
         // Json strings to inject in the data context
         ExtraOptionsResultCustomizer customizer = new ExtraOptionsResultCustomizer();

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/dashboard/ReportGenerator.java Thu Oct
20 20:07:31 2016
@@ -51,10 +51,12 @@ import org.apache.jmeter.report.processo
 import org.apache.jmeter.report.processor.MinAggregator;
 import org.apache.jmeter.report.processor.NormalizerSampleConsumer;
 import org.apache.jmeter.report.processor.RequestsSummaryConsumer;
+import org.apache.jmeter.report.processor.SampleConsumer;
 import org.apache.jmeter.report.processor.SampleContext;
 import org.apache.jmeter.report.processor.SampleSource;
 import org.apache.jmeter.report.processor.StatisticsSummaryConsumer;
 import org.apache.jmeter.report.processor.ThresholdSelector;
+import org.apache.jmeter.report.processor.Top5ErrorsBySamplerConsumer;
 import org.apache.jmeter.report.processor.graph.AbstractGraphConsumer;
 import org.apache.jmeter.reporters.ResultCollector;
 import org.apache.jmeter.samplers.SampleSaveConfiguration;
@@ -95,6 +97,7 @@ public class ReportGenerator {
     public static final String ERRORS_SUMMARY_CONSUMER_NAME = "errorsSummary";
     public static final String REQUESTS_SUMMARY_CONSUMER_NAME = "requestsSummary";
     public static final String STATISTICS_SUMMARY_CONSUMER_NAME = "statisticsSummary";
+    public static final String TOP5_ERRORS_BY_SAMPLER_CONSUMER_NAME = "top5ErrorsBySampler";
     public static final String START_INTERVAL_CONTROLLER_FILTER_CONSUMER_NAME = "startIntervalControlerFilter";
 
     private static final Pattern POTENTIAL_CAMEL_CASE_PATTERN = Pattern.compile("_(.)");
@@ -412,6 +415,14 @@ public class ReportGenerator {
         return excludeControllerFilter;
     }
 
+    private SampleConsumer createTop5ErrorsConsumer(ReportGeneratorConfiguration configuration)
{
+        Top5ErrorsBySamplerConsumer top5ErrorsBySamplerConsumer = new Top5ErrorsBySamplerConsumer();
+        top5ErrorsBySamplerConsumer.setName(TOP5_ERRORS_BY_SAMPLER_CONSUMER_NAME);
+        top5ErrorsBySamplerConsumer.setHasOverallResult(true);
+        top5ErrorsBySamplerConsumer.setIgnoreTransactionController(configuration.isIgnoreTCFromTop5ErrorsBySampler());
+        return top5ErrorsBySamplerConsumer;
+    }
+
     private StatisticsSummaryConsumer createStatisticsSummaryConsumer() {
         StatisticsSummaryConsumer statisticsSummaryConsumer = new StatisticsSummaryConsumer();
         statisticsSummaryConsumer.setName(STATISTICS_SUMMARY_CONSUMER_NAME);
@@ -466,6 +477,7 @@ public class ReportGenerator {
         nameFilter.addSampleConsumer(createApdexSummaryConsumer());
         nameFilter.addSampleConsumer(createRequestsSummaryConsumer());
         nameFilter.addSampleConsumer(createStatisticsSummaryConsumer());
+        nameFilter.addSampleConsumer(createTop5ErrorsConsumer(configuration));
         return nameFilter;
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java Thu
Oct 20 20:07:31 2016
@@ -33,14 +33,14 @@ import org.apache.jmeter.util.JMeterUtil
  */
 public class ErrorsSummaryConsumer extends AbstractSummaryConsumer<Long> {
 
-    private static final boolean ASSERTION_RESULTS_FAILURE_MESSAGE = 
+    static final boolean ASSERTION_RESULTS_FAILURE_MESSAGE = 
             JMeterUtils
                 .getPropDefault(
                         SampleSaveConfiguration.ASSERTION_RESULTS_FAILURE_MESSAGE_PROP,
                         true);
             
+    static final String ASSERTION_FAILED = "Assertion failed"; //$NON-NLS-1$
     private static final Long ZERO = Long.valueOf(0);
-    private static final String ASSERTION_FAILED = "Assertion failed"; //$NON-NLS-1$
     private long errorCount = 0L;
 
     /**
@@ -135,7 +135,7 @@ public class ErrorsSummaryConsumer exten
      *         FIXME Duplicates HTTPSamplerBase#isSuccessCode but it's in http
      *         protocol
      */
-    protected boolean isSuccessCode(String codeAsString) {
+    static boolean isSuccessCode(String codeAsString) {
         if (StringUtils.isNumeric(codeAsString)) {
             try {
                 int code = Integer.parseInt(codeAsString);

Added: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java?rev=1765870&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java
(added)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java
Thu Oct 20 20:07:31 2016
@@ -0,0 +1,191 @@
+/*
+ * 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;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.jmeter.report.core.Sample;
+import org.apache.jmeter.util.JMeterUtils;
+
+/**
+ * The class Top5ErrorsBySamplerConsumer provides a consumer that calculates
+ * the TOP5 of errors by sampler.
+ * 
+ * @since 3.1
+ */
+public class Top5ErrorsBySamplerConsumer extends
+        AbstractSummaryConsumer<Top5ErrorsSummaryData> {
+    static final int MAX_NUMBER_OF_ERRORS_IN_TOP = 5;
+    
+    private boolean ignoreTCFromTop5ErrorsBySampler;
+
+    /**
+     * Instantiates a new Top5 Errors by sampler consumer.
+     */
+    public Top5ErrorsBySamplerConsumer() {
+        super(true);
+    }
+
+    /**
+     * 
+     * @param sample {@link Sample}
+     * @param data {@link Top5ErrorsSummaryData}
+     * @param isOverall boolean indicating if aggregation concerns the Overall results in
which case we ignore Transaction Controller's SampleResult
+     */
+    private void aggregateSample(Sample sample, Top5ErrorsSummaryData data, boolean isOverall)
{
+        if(isOverall && sample.isController()) {
+            return;
+        }
+        
+        if(ignoreTCFromTop5ErrorsBySampler && sample.isController()) {
+            return;
+        }
+        
+        if(!sample.getSuccess()) {
+            data.registerError(getError(sample));
+            data.incErrors();
+        }
+        data.incTotal();
+    }
+    
+    private String getError(Sample sample) {
+        String responseCode = sample.getResponseCode();
+        String responseMessage = sample.getResponseMessage();
+        String key = responseCode + (!StringUtils.isEmpty(responseMessage) ? 
+                 "/" + StringEscapeUtils.escapeJson(responseMessage) : "");
+        if (ErrorsSummaryConsumer.isSuccessCode(responseCode)) {
+            key = ErrorsSummaryConsumer.ASSERTION_FAILED;
+            if (ErrorsSummaryConsumer.ASSERTION_RESULTS_FAILURE_MESSAGE) {
+                String msg = sample.getFailureMessage();
+                if (!StringUtils.isEmpty(msg)) {
+                    key = StringEscapeUtils.escapeJson(msg);
+                }
+            }
+        }
+        return key;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.jmeter.report.processor.AbstractSummaryConsumer#updateData
+     * (org.apache.jmeter.report.processor.AbstractSummaryConsumer.SummaryInfo,
+     * org.apache.jmeter.report.core.Sample)
+     */
+    @Override
+    protected void updateData(SummaryInfo info, Sample sample) {
+        SummaryInfo overallInfo = getOverallInfo();
+        Top5ErrorsSummaryData overallData = overallInfo.getData();
+        if (overallData == null) {
+            overallData = new Top5ErrorsSummaryData();
+            overallInfo.setData(overallData);
+        }
+
+        Top5ErrorsSummaryData data = info.getData();
+        if (data == null) {
+            data = new Top5ErrorsSummaryData();
+            info.setData(data);
+        }
+
+        if(!sample.isEmptyController()) {
+            aggregateSample(sample, data, false);
+            aggregateSample(sample, overallData, true);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.jmeter.report.processor.AbstractSummaryConsumer#createDataResult
+     * (java.lang.String)
+     */
+    @Override
+    protected ListResultData createDataResult(String key,
+            Top5ErrorsSummaryData data) {
+        ListResultData result = new ListResultData();
+        long errors = data.getErrors();
+        if(errors > 0 || key == null) {
+            result.addResult(new ValueResultData(
+                    key != null ? key : JMeterUtils.getResString("reportgenerator_top5_total")));
+            long total = data.getTotal();
+            
+            result.addResult(new ValueResultData(Long.valueOf(total)));
+            result.addResult(new ValueResultData(Long.valueOf(errors)));
+            Object[][] top5 = data.getTop5ErrorsMetrics();
+
+            int numberOfValues = 0;
+            for (int i = 0; i < top5.length; i++) {
+                result.addResult(new ValueResultData(top5[i][0]));
+                result.addResult(new ValueResultData(top5[i][1]));
+                numberOfValues++;            
+            }
+            for (int i = numberOfValues; i < MAX_NUMBER_OF_ERRORS_IN_TOP; i++) {
+                result.addResult(new ValueResultData(""));
+                result.addResult(new ValueResultData(""));   
+            }
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.jmeter.report.processor.AbstractSummaryConsumer#getKeyFromSample
+     * (org.apache.jmeter.report.core.Sample)
+     */
+    @Override
+    protected String getKeyFromSample(Sample sample) {
+        return sample.getName();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.jmeter.report.processor.AbstractSummaryConsumer#createResultTitles
+     * ()
+     */
+    @Override
+    protected ListResultData createResultTitles() {
+        ListResultData titles = new ListResultData();
+        titles.addResult(new ValueResultData(JMeterUtils
+            .getResString("reportgenerator_top5_label")));
+        titles.addResult(new ValueResultData(JMeterUtils
+            .getResString("reportgenerator_top5_sample_count")));
+        titles.addResult(new ValueResultData(JMeterUtils
+            .getResString("reportgenerator_top5_error_count")));
+        for (int i = 0; i < MAX_NUMBER_OF_ERRORS_IN_TOP; i++) {
+            titles.addResult(new ValueResultData(
+                    JMeterUtils.getResString("reportgenerator_top5_error_label")));
+            titles.addResult(new ValueResultData(
+                    JMeterUtils.getResString("reportgenerator_top5_error_count")));     
      
+        }
+        return titles;
+    }
+
+    /**
+     * @param ignoreTCFromTop5ErrorsBySampler
+     */
+    public void setIgnoreTransactionController(
+            boolean ignoreTCFromTop5ErrorsBySampler) {
+        this.ignoreTCFromTop5ErrorsBySampler = ignoreTCFromTop5ErrorsBySampler;
+    }
+}

Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsBySamplerConsumer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java?rev=1765870&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java (added)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java Thu
Oct 20 20:07:31 2016
@@ -0,0 +1,111 @@
+/*
+ * 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;
+
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+/**
+ * Summary data for TOP 5 of errors.
+ * Compute a map of Sample / Number of errors
+ * @since 3.1
+ */
+public class Top5ErrorsSummaryData {
+
+    private static final Long ONE = new Long(1);
+    private Map<String, Long> countPerError;
+    private long total;
+    private long errors;
+
+    /**
+     */
+    public Top5ErrorsSummaryData() {
+        countPerError = new HashMap<String, Long>();
+    }
+
+    /**
+     * 
+     * @param errorMessage String error message to add
+     */
+    public void registerError(String errorMessage) {
+        Long value = countPerError.get(errorMessage);
+        if(value == null) {
+            countPerError.put(errorMessage, ONE);
+        } else {
+            countPerError.put(errorMessage, Long.valueOf(value.longValue()+1));
+        }
+    }
+    
+    /**
+     * Increment errors
+     */
+    public void incErrors() {
+        errors++;
+    }
+    
+    /**
+     * Increment total
+     */
+    public void incTotal() {
+        total++;
+    }
+
+    /**
+     * @return the total
+     */
+    public long getTotal() {
+        return total;
+    }
+
+    /**
+     * @return the errors
+     */
+    public long getErrors() {
+        return errors;
+    }
+
+    /**
+     * Return Top 5 errors
+     * @return array of [String, Long]
+     */
+    public Object[][] getTop5ErrorsMetrics() {
+        SortedSet<Map.Entry<String, Long>> reverseSortedSet = new TreeSet<Map.Entry<String,
Long>>(
+                new Comparator<Map.Entry<String, Long>>() {
+                    @Override
+                    public int compare(Map.Entry<String, Long> e1,
+                            Map.Entry<String, Long> e2) {
+                        return -e1.getValue().compareTo(e2.getValue());
+                    }
+                });
+        
+        reverseSortedSet.addAll(countPerError.entrySet());
+        Object[][] result = new Object[Top5ErrorsBySamplerConsumer.MAX_NUMBER_OF_ERRORS_IN_TOP][2];
+        int size = 0;
+        for (Map.Entry<String, Long> entry : reverseSortedSet) {
+            if(size == Top5ErrorsBySamplerConsumer.MAX_NUMBER_OF_ERRORS_IN_TOP) {
+                break;
+            }
+            result[size] = new Object[] {entry.getKey(), entry.getValue()};
+            size++;
+        }
+        return result;
+    }
+}

Propchange: jmeter/trunk/src/core/org/apache/jmeter/report/processor/Top5ErrorsSummaryData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Thu Oct 20 20:07:31
2016
@@ -861,6 +861,11 @@ report_summary=Report Summary
 report_table=Report Table
 report_writer=Report Writer
 report_writer_html=HTML Report Writer
+reportgenerator_top5_error_count=#Errors
+reportgenerator_top5_error_label=Error
+reportgenerator_top5_label=Sample
+reportgenerator_top5_sample_count=#Samples
+reportgenerator_top5_total=Total
 reportgenerator_summary_apdex_apdex=Apdex
 reportgenerator_summary_apdex_samplers=Label
 reportgenerator_summary_apdex_satisfied=T (Toleration threshold)  

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Thu Oct 20 20:07:31
2016
@@ -846,6 +846,11 @@ report_summary=Rapport r\u221A\u00A9sum\
 report_table=Table du Rapport
 report_writer=R\u221A\u00A9dacteur du Rapport
 report_writer_html=R\u221A\u00A9dacteur de rapport HTML
+reportgenerator_top5_error_count=#Erreurs
+reportgenerator_top5_error_label=Erreur
+reportgenerator_top5_label=Echantillon
+reportgenerator_top5_sample_count=#Echantillons
+reportgenerator_top5_total=Total
 reportgenerator_summary_apdex_apdex=Apdex
 reportgenerator_summary_apdex_samplers=Libell\u00E9
 reportgenerator_summary_apdex_satisfied=T (Seuil de tol\u00E9rance)

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Oct 20 20:07:31 2016
@@ -172,6 +172,7 @@ Summary
     <li><bug>60115</bug>Add date format property for start/end date filter
into Report generator</li>
     <li><bug>60171</bug>Report / Dashboard : Active Threads Over Time should
stack lines to give the total amount of threads running</li>
     <li><bug>60250</bug>Report / Dashboard : Need to Add Sent KB/s in Statistics
Report of HTML Dashboard</li>
+    <li><bug>60287</bug>Report / Dashboard : Have a new Top5 Errors by
sampler table in Dashboard. Implemented by Philippe Mouawad (p.mouawad at ubik-ingenierie.com)
and contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 </ul>
 <h3>General</h3>
 <ul>

Modified: jmeter/trunk/xdocs/usermanual/generating-dashboard.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/generating-dashboard.xml?rev=1765870&r1=1765869&r2=1765870&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/generating-dashboard.xml (original)
+++ jmeter/trunk/xdocs/usermanual/generating-dashboard.xml Thu Oct 20 20:07:31 2016
@@ -31,18 +31,22 @@
                     <li>A request summary graph showing the Success and failed requests
(Transaction Controller Sample Results are not taken into account) percentage: <figure
width="1658" height="650" image="dashboard/report_apdex_and_summary.png" ></figure></li>
                     <li>A Statistics table providing in one table a summary of all
metrics per transaction including 3 configurable percentiles : <figure width="1376" height="433"
image="dashboard/report_statistics.png" ></figure></li>
                     <li>An error table providing a summary of all errors and their
proportion in the total requests : <figure width="1344" height="455" image="dashboard/report_errors.png"
></figure></li>
+                    <li>A Top 5 Errors by Samplertable providing for every Sampler
(excluding Transaction Controller by default) the top 5 Errors</li>
                     <li>Zoomable chart where you can check/uncheck every transaction
to show/hide it for:
                         <ul>
                             <li>Response times Over Time (Includes Transaction Controller
Sample Results) : <figure width="1398" height="566" image="dashboard/report_response_times_over_time.png"
></figure></li>
+                            <li>Response times Percentiles Over Time (successful responses
only)</li>
+                            <li>Active Threads Over Time : <figure width="1370"
height="542" image="dashboard/report_active_threads_over_time.png" ></figure></li>
                             <li>Bytes throughput Over Time (Ignores Transaction Controller
Sample Results)  : <figure width="1373" height="543" image="dashboard/report_bytes_throughput_over_time.png"
></figure></li>
                             <li>Latencies Over Time (Includes Transaction Controller
Sample Results) : <figure width="1373" height="547" image="dashboard/report_latencies_over_time.png"
></figure></li>
+                            <li>Connect Time Over Time (Includes Transaction Controller
Sample Results)</li>
                             <li>Hits per second (Ignores Transaction Controller Sample
Results): <figure width="1375" height="552" image="dashboard/report_hits_per_second.png"
></figure></li>
                             <li>Response codes per second (Ignores Transaction Controller
Sample Results): <figure width="1380" height="558" image="dashboard/report_codes_per_second.png"
></figure></li>
                             <li>Transactions per second (Includes Transaction Controller
Sample Results): <figure width="1372" height="577" image="dashboard/report_transactions_per_second.png"
></figure></li>
                             <li>Response Time vs Request per second (Ignores Transaction
Controller Sample Results): <figure width="1380" height="545" image="dashboard/report_response_time_vs_request.png"
></figure></li>
                             <li>Latency vs Request per second (Ignores Transaction
Controller Sample Results): <figure width="1373" height="543" image="dashboard/report_latencies_vs_request.png"
></figure></li>
+                            <li>Response time Overview (Excludes Transaction Controller
Sample Results)</li>
                             <li>Response times percentiles (Includes Transaction Controller
Sample Results): <figure width="1374" height="551" image="dashboard/report_response_time_percentiles.png"
></figure></li>
-                            <li>Active Threads Over Time : <figure width="1370"
height="542" image="dashboard/report_active_threads_over_time.png" ></figure></li>
                             <li>Times vs Threads (Includes Transaction Controller Sample
Results): <figure width="1373" height="567" image="dashboard/report_time_vs_threads.png"
></figure></li>
                             <li>Response Time Distribution (Includes Transaction Controller
Sample Results): <figure width="1373" height="549" image="dashboard/report_response_time_distribution.png"
></figure></li>
                         </ul>
@@ -75,6 +79,8 @@ jmeter.save.saveservice.thread_counts =
 jmeter.save.saveservice.thread_name = true
 jmeter.save.saveservice.time = true
 jmeter.save.saveservice.connect_time = true
+# Only available with HttpClient4
+#jmeter.save.saveservice.sent_bytes=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



Mime
View raw message