jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: long\int Sum fuction
Date Tue, 03 May 2011 19:22:33 GMT
On 3 May 2011 18:24, Bruce Ide <flyingrhenquest@gmail.com> wrote:
> ints and longs don't do real numbers. I don't see a function to use floats,
> which seems odd to me.

The functions are generally used with counters and pauses etc., which
only need integral values.

> I'm sure you could add up your numbers with a BSF
> sampler, though. Something like
>
> Float myFloat = ${varWithReals} // Or use
> Float.parseFloat(vars.get("varWithReals"));
> Float accumulate = ${accumulatorVar} + myFloat;
> vars.put("accumulatorVar", Float.toString(accumulate));
>
> It's kind of a long way to go to get that, though. Perhaps someone can
> suggest an easier method.

There are several scripting functions, see:

http://jakarta.apache.org/jmeter/usermanual/functions.html#__jexl
http://jakarta.apache.org/jmeter/usermanual/functions.html#__javaScript
http://jakarta.apache.org/jmeter/usermanual/functions.html#__BeanShell

> You may prefer to use Double than Float, depending on how big/small your
> numbers are.
>
> --
> Bruce Ide
> FlyingRhenquest@gmail.com
>

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


Mime
View raw message