Author: sebb
Date: Wed Dec 16 17:49:21 2009
New Revision: 891348

URL: http://svn.apache.org/viewvc?rev=891348&view=rev
Log:
Aggregate Report and Summary Report now allow column headers to be optionally 
excluded

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

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java?rev=891348&r1=891347&r2=891348&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
 Wed Dec 16 17:49:21 2009
@@ -75,6 +75,8 @@
 
     private static final String USE_GROUP_NAME = "useGroupName"; //$NON-NLS-1$
 
+    private static final String SAVE_HEADERS   = "saveHeaders"; //$NON-NLS-1$
+
     private static final String[] COLUMNS = {
             "sampler_label",                 //$NON-NLS-1$
             "aggregate_report_count",        //$NON-NLS-1$
@@ -97,6 +99,9 @@
     private final JButton saveTable =
         new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));   
         //$NON-NLS-1$
 
+    private final JCheckBox saveHeaders = // should header be saved with the 
data?
+        new 
JCheckBox(JMeterUtils.getResString("aggregate_graph_save_table_header"),true);  
  //$NON-NLS-1$
+
     private final JCheckBox useGroupName =
         new 
JCheckBox(JMeterUtils.getResString("aggregate_graph_use_group_name"));          
  //$NON-NLS-1$
 
@@ -219,6 +224,7 @@
         JPanel opts = new JPanel();
         opts.add(useGroupName, BorderLayout.WEST);
         opts.add(saveTable, BorderLayout.CENTER);
+        opts.add(saveHeaders, BorderLayout.EAST);
         this.add(opts,BorderLayout.SOUTH);
     }
 
@@ -226,12 +232,14 @@
     public void modifyTestElement(TestElement c) {
         super.modifyTestElement(c);
         c.setProperty(USE_GROUP_NAME, useGroupName.isSelected(), false);
+        c.setProperty(SAVE_HEADERS, saveHeaders.isSelected(), true);
     }
 
     @Override
     public void configure(TestElement el) {
         super.configure(el);
         useGroupName.setSelected(el.getPropertyAsBoolean(USE_GROUP_NAME, 
false));
+        saveHeaders.setSelected(el.getPropertyAsBoolean(SAVE_HEADERS, true));
     }
 
     public void actionPerformed(ActionEvent ev) {
@@ -243,7 +251,7 @@
             FileWriter writer = null;
             try {
                 writer = new FileWriter(chooser.getSelectedFile());
-                CSVSaveService.saveCSVStats(model,writer);
+                CSVSaveService.saveCSVStats(model,writer, 
saveHeaders.isSelected());
             } catch (FileNotFoundException e) {
                 log.warn(e.getMessage());
             } catch (IOException e) {

Modified: 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java?rev=891348&r1=891347&r2=891348&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
 (original)
+++ 
jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
 Wed Dec 16 17:49:21 2009
@@ -68,6 +68,8 @@
 
     private static final String USE_GROUP_NAME = "useGroupName"; //$NON-NLS-1$
 
+    private static final String SAVE_HEADERS   = "saveHeaders"; //$NON-NLS-1$
+
     private static final String[] COLUMNS = {
             "sampler_label",               //$NON-NLS-1$
             "aggregate_report_count",      //$NON-NLS-1$
@@ -91,6 +93,9 @@
     private final JButton saveTable =
         new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));   
         //$NON-NLS-1$
 
+    private final JCheckBox saveHeaders = // should header be saved with the 
data?
+        new 
JCheckBox(JMeterUtils.getResString("aggregate_graph_save_table_header"),true);  
  //$NON-NLS-1$
+
     private final JCheckBox useGroupName =
         new 
JCheckBox(JMeterUtils.getResString("aggregate_graph_use_group_name"));          
  //$NON-NLS-1$
 
@@ -210,6 +215,7 @@
         JPanel opts = new JPanel();
         opts.add(useGroupName, BorderLayout.WEST);
         opts.add(saveTable, BorderLayout.CENTER);
+        opts.add(saveHeaders, BorderLayout.EAST);
         this.add(opts,BorderLayout.SOUTH);
     }
 
@@ -217,12 +223,14 @@
     public void modifyTestElement(TestElement c) {
         super.modifyTestElement(c);
         c.setProperty(USE_GROUP_NAME, useGroupName.isSelected(), false);
+        c.setProperty(SAVE_HEADERS, saveHeaders.isSelected(), true);
     }
 
     @Override
     public void configure(TestElement el) {
         super.configure(el);
         useGroupName.setSelected(el.getPropertyAsBoolean(USE_GROUP_NAME, 
false));
+        saveHeaders.setSelected(el.getPropertyAsBoolean(SAVE_HEADERS, true));
     }
 
     public void actionPerformed(ActionEvent ev) {
@@ -234,7 +242,7 @@
             FileWriter writer = null;
             try {
                 writer = new FileWriter(chooser.getSelectedFile());
-                CSVSaveService.saveCSVStats(model,writer);
+                CSVSaveService.saveCSVStats(model,writer, 
saveHeaders.isSelected());
             } catch (FileNotFoundException e) {
                 log.warn(e.getMessage());
             } catch (IOException e) {

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=891348&r1=891347&r2=891348&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Wed Dec 16 17:49:21 2009
@@ -159,6 +159,7 @@
 as the Sample cache has been moved to the new CachingStatCalculator class.
 In particular, Aggregate Report can now handle large numbers of samples.
 </li>
+<li>Aggregate Report and Summary Report now allow column headers to be 
optionally excluded</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org

Reply via email to