i-nahornyi opened a new issue, #6762:
URL: https://github.com/apache/jmeter/issues/6762

   ### Use case
   
   There is currently no explicit/documented field in `SampleResult` that 
identifies the type of result, such as `SAMPLE` or `TRANSACTION`.
   
   The current workaround is to use:
   
   ```java
   TransactionController.isFromTransactionController(sampleResult)
   ```
   
   However, this approach is fragile because transaction detection depends on 
other `SampleResult` fields. In particular, it can break when a user redefines 
the `responseMessage` of the Transaction Controller with a custom value.
   
   This behavior is also not documented, so users have no way to know that 
redefining the Transaction Controller's `responseMessage` can silently break 
transaction detection.
   
   ### Possible solution
   
   Add an explicit `sampleType` field to `SampleResult`, for example:
   
   ```java
   public enum SampleType {
       SAMPLE,
       TRANSACTION
   }
   ```
   
   Then consumers could use:
   
   ```java
   sampleResult.getSampleType() == SampleType.TRANSACTION
   ```
   
   This would provide a reliable way for listeners, backend listeners, plugins, 
and other consumers to identify the type of a `SampleResult`.
   
   ### Possible workarounds
   
   _No response_
   
   ### JMeter Version
   
   5.6.3
   
   ### Java Version
   
   java 17.0.7
   
   ### OS Version
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to