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:41 UTC

[jmeter] 37/47: The change of key to include the thread name was wrong It worked, but fewer samples could be aggregated.

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 582f2a5a72067e5481a6e060eb4f1704e57ddfe0
Author: Sebastian Bazley <se...@apache.org>
AuthorDate: Sun Sep 23 17:44:11 2007 +0000

    The change of key to include the thread name was wrong
    It worked, but fewer samples could be aggregated.
    
    git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@578591 13f79535-47bb-0310-9956-ffa450edef68
    
    Former-commit-id: 98c07f9b9fdaefb8edd1a126f860ed1aea13fbf6
---
 src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java b/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
index 81529fa..66007a9 100644
--- a/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
+++ b/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
@@ -50,7 +50,7 @@ public class StatisticalSampleResult extends SampleResult implements
 	public StatisticalSampleResult(SampleResult res) {
 		// Copy data that is shared between samples (i.e. the key items):
 		setSampleLabel(res.getSampleLabel());
-		setThreadName(res.getThreadName());
+		// Nothing else can be saved, as the samples may come from any thread
 
 		setSuccessful(true); // Assume result is OK
 		setSampleCount(0); // because we add the sample count in later
@@ -106,9 +106,8 @@ public class StatisticalSampleResult extends SampleResult implements
 	 * @return the key to use for aggregating samples
 	 */
 	public static String getKey(SampleEvent event) {
-		SampleResult result = event.getResult();
 		StringBuffer sb = new StringBuffer(80);
-		sb.append(result.getSampleLabel()).append("-").append(result.getThreadName());
+		sb.append(event.getResult().getSampleLabel()).append("-").append(event.getThreadGroup());
 		return sb.toString();
 	}
 }