sebb-2-2 wrote:
>
> On 7 January 2011 12:00, zhouyuan <[email protected]> wrote:
>>
>> Hi sebb! I tried to do it in the following way:
>>
>> import org.apache.jmeter.control.TransactionSampler;
>> import org.apache.jmeter.control.TransactionController;
>> import org.apache.jmeter.util.JMeterUtils;
>>
>> TransactionSampler ts = new TransactionSampler();
>>
>> //print(ts);
>>
>> sp = ctx.getCurrentSampler();
>>
>> print("sampler:"+sp);
>>
>> ct = JMeterUtils.getControllers(sp);
>>
>> print("controller:"+ct);
>>
>> previous = ts.getTransactionResult();
>>
>> print("haha"+previous);
>>
>> tt=previous.getTime();
>>
>> print(tt);
>>
>> But I can't the right properties of sampler... I also tried to create a
>> new
>> instance of Transaction Controller, it also doesn't work... I don't know
>> how
>> to get the results in transactions. Could you help to take a look?
>> Thanks!
>
> Where does the Transaction Controller store its result?
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Transaction_Controller
>
> says:
>
> "The Transaction Controller generates an additional sample which
> measures the overall time taken to perform the nested test elements."
>
> So try looking at the previous sample result.
>
>> --
>> View this message in context:
>> http://jmeter.512774.n5.nabble.com/How-to-get-transaction-time-into-a-user-defined-variable-tp3328587p3331734.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
I try to get the previous sample result using BeanShell PostProcessor like
this:
print("prev:"+prev);
long rt1=prev.getTime();
print(rt1);
But it only shows the sample result of nested http requests not the parent
sample... I also tried simple controller to contain the samples in it... but
the problem remained the same.
--
View this message in context:
http://jmeter.512774.n5.nabble.com/How-to-get-transaction-time-into-a-user-defined-variable-tp3328587p3332027.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]