jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: measuring time in "while" loop
Date Tue, 11 Dec 2012 23:52:52 GMT
On 11 December 2012 23:27, BOLB (Bohdan L Bodnar) <BOLB@panduit.com> wrote:
> I'm doing something incorrectly, but I cannot figure out what:
>
> 1). A "User Parameter" block is used to assign the system to variable "START" using 
${__time(,)} at the beginning of the loop and the same is done to variable "END" at the end
of the loop.
>
> 2). A Beanshell Sampler is used to write to a file; the sample code is:
>
> ${__longSum(${END},-${START},output1)};
> f = new FileOutputStream("c:\\file1.txt");
> p = new PrintStream(f);
> this.interpreter.setOut(p);
> print(output1);
>
> Upon execution, the following error message is received:
>
> Response code: 500
> Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method:
eval      Sourced file: inline evaluation of: ``0; f = new FileOutputStream("c:\file1.txt");
p = new PrintStream(f); this.interp . . . '' : Object constructor
>
>
> What, if anything, am I doing incorrectly (btw, this is jmeter 2.8)?

Try using the Java sampler instead; it's much simpler.
Just reference the variable in the sample data or the label and it
will appear in the sample results.

Alternatively, see:

http://jmeter.apache.org/usermanual/listeners.html#sample_variables

which is simpler still
> Thanks,
>
> Bo
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, December 11, 2012 2:01 PM
> To: JMeter Users List
> Subject: Re: measuring time in "while" loop
>
>> use it in a Java Sampler.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message