jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Save CSV sub-results recursively from Visual Result Tree
Date Thu, 11 Feb 2021 19:17:25 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new f905a07  Save CSV sub-results recursively from Visual Result Tree
f905a07 is described below

commit f905a07259e5e6c092a619ea3be281f7e6d041e0
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Thu Dec 10 17:02:13 2020 +0100

    Save CSV sub-results recursively from Visual Result Tree
    
    Bugzilla Id: 64962
---
 .../java/org/apache/jmeter/save/CSVSaveService.java    | 18 ++++++++++++++----
 xdocs/changes.xml                                      |  1 +
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java b/src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java
index 2f21dc5..8d82bad 100644
--- a/src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java
+++ b/src/core/src/main/java/org/apache/jmeter/save/CSVSaveService.java
@@ -1112,10 +1112,20 @@ public final class CSVSaveService {
 
         if(saveConfiguration.saveSubresults()) {
             SampleResult result = event.getResult();
-            for (SampleResult subResult : result.getSubResults()) {
-                formattedResult = resultToDelimitedString(event, subResult, saveConfiguration,
delimiter);
-                out.println(formattedResult);
-            }
+            saveSubResults(event, out, saveConfiguration, delimiter, result, 0);
+        }
+    }
+
+    private static void saveSubResults(SampleEvent event, PrintWriter out, SampleSaveConfiguration
saveConfiguration,
+            String delimiter, SampleResult result, int recursionLevel) {
+        if (recursionLevel > 10) {
+            return;
+        }
+        String formattedResult;
+        for (SampleResult subResult : result.getSubResults()) {
+            saveSubResults(event, out, saveConfiguration, delimiter, subResult, recursionLevel
+ 1);
+            formattedResult = resultToDelimitedString(event, subResult, saveConfiguration,
delimiter);
+            out.println(formattedResult);
         }
     }
 }
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 6f893ca..8798903 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -137,6 +137,7 @@ Summary
 
 <h3>Listeners</h3>
 <ul>
+  <li><bug>64962</bug>Save CSV sub-results recursively from View Results
Tree</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>


Mime
View raw message