apache / apache/jmeter

SampleEvent for TransactionSampler: isTransactionSampleEvent return false with parent mode

Open
#3,565 4 comments 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Myoung** ([Bug 57730](https://bz.apache.org/bugzilla//show_bug.cgi?id=57730&redirect=false)):
With parent mode on TransactionCotroller.
The isTransactionSampleEvent() on SampleEvent object always returns "false" even with TransactionSampler.
Please make it return "TRUE" with TransactionSampler not only “non parent mode” but also “parent mode”

Reason) I am trying the develop the PacingTimer(similar functionality which is provided by commercial testing tools), and i want to define the target mode of “Iteration”, “Transaction” and “Sampler” to which applying the pacing time since many of people is familiar with Transaction pacing and Iteration pacing too. To implement this “Transaction mode” requirement, I need a way to say whether it is parent mode or not.
I could modify the JmeterThread codes as below, however I never wants to touch the JMeter released build.

Here what I tested for my requset, I had to change couple of code of JmeterThread.java
<<<original>>>>
(method : process_sampler)
if(transactionSampler != null) {
:
notifyListeners(transactionPack.getSampleListeners(), transactionResult);
:
}
(mdthod notifyListeners)
SampleEvent event = new SampleEvent(result, threadGroup.getName(), threadVars);
notifier.notifyListeners(event, listeners);

private void notifyListeners(List<SampleListener> listeners, SampleResult result, boolean isTransactionSampleEvent) {
SampleEvent event = new SampleEvent(result, threadGroup.getName(), threadVars,isTransactionSampleEvent);
notifier.notifyListeners(event, listeners);

}
<<<<<changes .... >>>>
(method : process_sampler)
if(transactionSampler != null) {
:
notifyListeners(transactionPack.getSampleListeners(), transactionResult, true); //add parameter for transaction sampler
:
}
(mdthod notifyListeners )
private void notifyListeners(List<SampleListener> listeners, SampleResult result) {
notifyListeners(listeners,result,false);
}

private void notifyListeners(List<SampleListener> listeners, SampleResult result, boolean isTransactionSampleEvent) {
SampleEvent event = new SampleEvent(result, threadGroup.getName(), threadVars,isTransactionSampleEvent);
notifier.notifyListeners(event, listeners);
}

best regards
myoung

Created attachment [pacingtimer.png](https://apache.github.io/jmeter-bugzilla-attachments/30/57730/32588/pacingtimer.png): the gui design for my pacingtimer plugin.

the gui design for my pacingtimer plugin.

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.