jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Groovy
Date Fri, 05 Jul 2013 14:29:27 GMT
On 5 July 2013 15:09, Danny Lade <D.Lade@bigpoint.net> wrote:
>> > For the "groovy thing":
>> > I would really wish to have scripts that are cached. But currently (using 2.9)
this
>> functionality can't be used for Java or beanshell.
>> > As I found out it is deactivated in the code to "handle some bug". We
>> > would use scripts much more often , but they are currently not useful for
>> massive load tests (but for setup). For example we often manipulate JSON input
>> for REST requests.
>>
>> So why not convert the Groovy script to a Java test element?
>>
> Because it is a new plugin which gets to be deployed with every change to all
> computers producing the load. Scripts are easy to change and mustn't deployed
> (it's done by JMeter automatically).
>
>> > * or bundle groovy which seems to allow caching
>>
>> Including Groovy in the JMeter download won't change the behaviour from
>> downloading it separately.
>> In both cases the jar is present in the classpath; how can that affect caching?
>>
> I'm not sure how could you know the code about JSR223TestElement is implementing
> the support for "script compilation caching", so here comes some short code:
>
> processFileOrScript()
>         // Hack as in bsh-2.0b5.jar BshScriptEngine implements Compilable but throws
new Error
>         boolean supportsCompilable = scriptEngine instanceof Compilable
>                 && !(scriptEngine.getClass().getName().equals("bsh.engine.BshScriptEngine"));
>
> Because the JavaScriptEngine is based on the BshScriptEngine the "script compilation
caching"
> isn't available for Java, but it is available for groovy.

Which JavaScriptEngine?

> And therefore a (pre)compiled script does not load any classes (but in the very first
step), then
> there is no synchronization with each call anymore.
>
> Is that understandable?
>
> I'm not saying "you must install groovy" , I just want to be sure having a scripting
engine
> with "script compilation caching" working (or without any synchronization during runtime).

Script compilation is already possible - just download and use Groovy
or another Compilable scripting language.

What I am saying is that there is no need to include Groovy in the
JMeter binary release.
It works just as well if it is downloaded separately.

And if the BSH Compilable bug can be fixed, users could then use BeanShell.

> Greetings Danny
>

Mime
View raw message