You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by vl...@apache.org on 2019/06/08 18:42:32 UTC

[jmeter] 28/47: Bug 43450 (partial fix) - Allow SampleCount to be saved/restored from XML files too

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to annotated tag v2_3
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit b23a6a69dc05c5158e74731692dadec3f1a34ddd
Author: Sebastian Bazley <se...@apache.org>
AuthorDate: Sat Sep 22 00:52:24 2007 +0000

    Bug 43450 (partial fix) - Allow SampleCount to be saved/restored from XML files too
    
    git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@578339 13f79535-47bb-0310-9956-ffa450edef68
    
    Former-commit-id: 943b0d80e49a9c056bc988ba0437e7be02632dc4
---
 .../org/apache/jmeter/save/converters/SampleResultConverter.java     | 5 +++++
 xdocs/changes.xml                                                    | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java b/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
index 2bcf5c1..9ca75f1 100644
--- a/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
+++ b/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
@@ -78,6 +78,7 @@ public class SampleResultConverter extends AbstractCollectionConverter {
     private static final String ATT_RESPONSE_CODE_OLD = "rs"; //$NON-NLS-1$
     
     private static final String ATT_SUCCESS           = "s";  //$NON-NLS-1$
+    private static final String ATT_SAMPLE_COUNT      = "sc"; //$NON-NLS-1$
     private static final String ATT_TIME              = "t";  //$NON-NLS-1$
     private static final String ATT_TIME_STAMP        = "ts"; //$NON-NLS-1$
     private static final String ATT_THREADNAME        = "tn"; //$NON-NLS-1$
@@ -248,6 +249,9 @@ public class SampleResultConverter extends AbstractCollectionConverter {
 			writer.addAttribute(ATT_DATA_ENCODING, ConversionHelp.encode(res.getDataEncoding()));
 		if (save.saveBytes())
 			writer.addAttribute(ATT_BYTES, String.valueOf(res.getBytes()));
+        if (save.saveSampleCount()){
+        	writer.addAttribute(ATT_SAMPLE_COUNT, String.valueOf(res.getSampleCount()));
+        }
         if (save.saveThreadCounts()){// These cannot be restored
         	org.apache.jmeter.threads.ThreadGroup 
         	threadGroup=JMeterContextService.getContext().getThreadGroup();
@@ -357,6 +361,7 @@ public class SampleResultConverter extends AbstractCollectionConverter {
 				Converter.getLong(reader.getAttribute(ATT_TIME)));
 		res.setLatency(Converter.getLong(reader.getAttribute(ATT_LATENCY)));
 		res.setBytes(Converter.getInt(reader.getAttribute(ATT_BYTES)));
+		res.setSampleCount(Converter.getInt(reader.getAttribute(ATT_SAMPLE_COUNT),1)); // default is 1
         // ATT_GRP_THRDS and ATT_ALL_THRDS are write only
 	}
 
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index f773e42..15b37cc 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -40,7 +40,7 @@
 <li>Fixup broken jmeter-server script</li>
 <li>Bug 43364 - option to revert If Controller to pre 2.3RC3 behaviour</li>
 <li>Bug 43449 - Statistical Remote mode does not handle Latency</li>
-<li>Bug 43450 (partial fix) - Allow SampleCount to be saved/restored from CSV files</li>
+<li>Bug 43450 (partial fix) - Allow SampleCount to be saved/restored from files</li>
 </ul>
 
 <h4>Improvements</h4>