jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1859118 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/ xdocs/
Date Sat, 11 May 2019 17:12:16 GMT
Author: fschumacher
Date: Sat May 11 17:12:15 2019
New Revision: 1859118

URL: http://svn.apache.org/viewvc?rev=1859118&view=rev
Log:
ArrayIndexOutOfBoundsException in Aggregate Graph when selecting 90% or 95% columns

The labels for the graph models need other parameters than those for the table.

Bugzilla Id: 63319


Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java?rev=1859118&r1=1859117&r2=1859118&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java Sat May
11 17:12:15 2019
@@ -25,7 +25,9 @@ import java.awt.Component;
 import java.awt.GridLayout;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.EventListener;
 import java.util.LinkedHashMap;
 import java.util.Map.Entry;
 import java.util.Set;

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java?rev=1859118&r1=1859117&r2=1859118&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java Sat
May 11 17:12:15 2019
@@ -212,7 +212,7 @@ public class StatGraphVisualizer extends
 
     private int defaultHeight = 300;
 
-    private JComboBox<String> columnsList = new JComboBox<>(getLabels(GRAPH_COLUMNS));
+    private JComboBox<String> columnsList = new JComboBox<>(getLabels(GRAPH_COLUMNS,
getGraphColumnsMsgParameters()));
 
     private List<BarGraph> eltList = new ArrayList<>();
 
@@ -309,7 +309,7 @@ public class StatGraphVisualizer extends
         clearData();
         init();
     }
-    
+
     static final Object[][] getColumnsMsgParameters() { 
         return new Object[][] { null, 
             null,
@@ -326,6 +326,18 @@ public class StatGraphVisualizer extends
             null};
     }
 
+    static final Object[][] getGraphColumnsMsgParameters() {
+        return new Object[][] {
+            null,
+            null,
+            new Object[] { PCT1_LABEL },
+            new Object[] { PCT2_LABEL },
+            new Object[] { PCT3_LABEL },
+            null,
+            null
+        };
+    }
+
     private String[] keys(Map<String, ?> map) {
         return map.keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY);
     }
@@ -344,7 +356,7 @@ public class StatGraphVisualizer extends
      * @return ObjectTableModel
      */
     static ObjectTableModel createObjectTableModel() {
-        return new ObjectTableModel(getLabels(COLUMNS),
+        return new ObjectTableModel(getLabels(COLUMNS, getColumnsMsgParameters()),
                 SamplingStatCalculator.class,
                 new Functor[] {
                 new Functor("getLabel"),                    //$NON-NLS-1$
@@ -406,20 +418,21 @@ public class StatGraphVisualizer extends
             new NumberRenderer("#0.00"),    // Sent bytes per sec   //$NON-NLS-1$
         };
     }
-    
+
     /**
      * 
      * @param keys I18N keys
+     * @param columnMsgParams parameters to use to format the keys labels
      * @return labels
      */
-    static String[] getLabels(String[] keys) {
+    static String[] getLabels(String[] keys, Object[][] columnMsgParams) {
         String[] labels = new String[keys.length];
         for (int i = 0; i < labels.length; i++) {
-            labels[i]=MessageFormat.format(JMeterUtils.getResString(keys[i]), getColumnsMsgParameters()[i]);
+            labels[i]=MessageFormat.format(JMeterUtils.getResString(keys[i]), columnMsgParams[i]);
         }
         return labels;
     }
-    
+
     /**
      * We use this method to get the data, since we are using
      * ObjectTableModel, so the calling getDataVector doesn't
@@ -719,7 +732,7 @@ public class StatGraphVisualizer extends
                     OutputStreamWriter writer = new OutputStreamWriter(fo, Charset.forName("UTF-8"))){

                 CSVSaveService.saveCSVStats(getAllTableData(model, getFormatters()),
                         writer,
-                        saveHeaders.isSelected() ? getLabels(COLUMNS) : null);
+                        saveHeaders.isSelected() ? getLabels(COLUMNS, getColumnsMsgParameters())
: null);
             } catch (IOException e) { // NOSONAR Error is reported in GUI
                 JMeterUtils.reportErrorToUser(e.getMessage(), "Error saving data");
             } 

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java?rev=1859118&r1=1859117&r2=1859118&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java Sat May
11 17:12:15 2019
@@ -220,7 +220,7 @@ public class StatVisualizer extends Abst
                     OutputStreamWriter writer = new OutputStreamWriter(fo, Charset.forName("UTF-8"))){
                 CSVSaveService.saveCSVStats(StatGraphVisualizer.getAllTableData(model, StatGraphVisualizer.getFormatters()),
                         writer,
-                        saveHeaders.isSelected() ? StatGraphVisualizer.getLabels(StatGraphVisualizer.getColumns())
: null);
+                        saveHeaders.isSelected() ? StatGraphVisualizer.getLabels(StatGraphVisualizer.getColumns(),
StatGraphVisualizer.getColumnsMsgParameters()) : null);
             } catch (IOException e) {
                 JMeterUtils.reportErrorToUser(e.getMessage(), "Error saving data");
             }

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java?rev=1859118&r1=1859117&r2=1859118&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java Sat May 11
17:12:15 2019
@@ -90,6 +90,20 @@ public class SummaryReport extends Abstr
             "average_bytes",               //$NON-NLS-1$
             };
 
+    private static final Object[][] COLUMNS_PARAMS = {
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+            null,
+    };
+
     private final String TOTAL_ROW_LABEL
         = JMeterUtils.getResString("aggregate_report_total_label");  //$NON-NLS-1$
 
@@ -296,7 +310,7 @@ public class SummaryReport extends Abstr
             try (FileOutputStream fo = new FileOutputStream(chooser.getSelectedFile());
                     OutputStreamWriter writer = new OutputStreamWriter(fo, Charset.forName("UTF-8")))
{
                 CSVSaveService.saveCSVStats(StatGraphVisualizer.getAllTableData(model, FORMATS),writer,

-                        saveHeaders.isSelected() ? StatGraphVisualizer.getLabels(COLUMNS)
: null);
+                        saveHeaders.isSelected() ? StatGraphVisualizer.getLabels(COLUMNS,
COLUMNS_PARAMS) : null);
             } catch (IOException e) {
                 JMeterUtils.reportErrorToUser(e.getMessage(), "Error saving data");
             } 

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1859118&r1=1859117&r2=1859118&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sat May 11 17:12:15 2019
@@ -20,6 +20,7 @@
 <!ENTITY hellip   "&#x02026;" >
 <!ENTITY rarr     "&#x02192;" >
 <!ENTITY vellip   "&#x022EE;" >
+<!ENTITY nbsp     "&#x00A0;" >
 ]>
 <document>
 <properties>
@@ -142,6 +143,7 @@ to view the last major behaviors with th
 
 <h3>Listeners</h3>
 <ul>
+    <li><bug>63319</bug><code>ArrayIndexOutOfBoundsException</code>
in Aggregate Graph when selecting 90&nbsp;% or 95&nbsp;% columns</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message