You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Oliver Erlewein <ol...@erlewein.net> on 2016/03/03 01:30:18 UTC

JSR223 clarification

Hi all,

I wonder if someone can shed some light on this.

So, using Groovy JSR223 script that I load externally. The JMeter doco says
I need not worry about the Cache key as that is implicit with external
scripts. BUT I changed the script half way through the test and it
immediately had an effect on the test. That to me says the script is not
cached but loaded every time. Or is there some logic that looks for change?

Short question would be " do I need to set the Cache key when loading
external JSR223 Groovy scripts"?

Cheers Oliver

Re: JSR223 clarification

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
its at runtime

regards
deepak


On Mar 3, 2016 7:08 PM, "Oliver Erlewein" <ol...@erlewein.net> wrote:

> Hi Deepak,
>
> thanks for that but would it do that during runtime or at "build" time?
>
> Cheers Oliver
> On 3/03/2016 15:20, "Deepak Shetty" <sh...@gmail.com> wrote:
>
> > Hi
> > from JSR223TestElement (v2.13)
> >
> >     String cacheKey =
> >                                 getScriptLanguage()+"#"+ // $NON-NLS-1$
> >                                 scriptFile.getAbsolutePath()+"#"+  //
> > $NON-NLS-1$
> >                                         scriptFile.lastModified();
> >
> > So since lastModified is a component of the cache key , it should
> recompile
> > and pick up changes if you modify the script file
> > regards
> > deepak
> >
> > On Wed, Mar 2, 2016 at 4:30 PM, Oliver Erlewein <ol...@erlewein.net>
> > wrote:
> >
> > > Hi all,
> > >
> > > I wonder if someone can shed some light on this.
> > >
> > > So, using Groovy JSR223 script that I load externally. The JMeter doco
> > says
> > > I need not worry about the Cache key as that is implicit with external
> > > scripts. BUT I changed the script half way through the test and it
> > > immediately had an effect on the test. That to me says the script is
> not
> > > cached but loaded every time. Or is there some logic that looks for
> > change?
> > >
> > > Short question would be " do I need to set the Cache key when loading
> > > external JSR223 Groovy scripts"?
> > >
> > > Cheers Oliver
> > >
> >
>

Re: JSR223 clarification

Posted by Oliver Erlewein <ol...@erlewein.net>.
Hi Deepak,

thanks for that but would it do that during runtime or at "build" time?

Cheers Oliver
On 3/03/2016 15:20, "Deepak Shetty" <sh...@gmail.com> wrote:

> Hi
> from JSR223TestElement (v2.13)
>
>     String cacheKey =
>                                 getScriptLanguage()+"#"+ // $NON-NLS-1$
>                                 scriptFile.getAbsolutePath()+"#"+  //
> $NON-NLS-1$
>                                         scriptFile.lastModified();
>
> So since lastModified is a component of the cache key , it should recompile
> and pick up changes if you modify the script file
> regards
> deepak
>
> On Wed, Mar 2, 2016 at 4:30 PM, Oliver Erlewein <ol...@erlewein.net>
> wrote:
>
> > Hi all,
> >
> > I wonder if someone can shed some light on this.
> >
> > So, using Groovy JSR223 script that I load externally. The JMeter doco
> says
> > I need not worry about the Cache key as that is implicit with external
> > scripts. BUT I changed the script half way through the test and it
> > immediately had an effect on the test. That to me says the script is not
> > cached but loaded every time. Or is there some logic that looks for
> change?
> >
> > Short question would be " do I need to set the Cache key when loading
> > external JSR223 Groovy scripts"?
> >
> > Cheers Oliver
> >
>

Re: JSR223 clarification

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
from JSR223TestElement (v2.13)

    String cacheKey =
                                getScriptLanguage()+"#"+ // $NON-NLS-1$
                                scriptFile.getAbsolutePath()+"#"+  //
$NON-NLS-1$
                                        scriptFile.lastModified();

So since lastModified is a component of the cache key , it should recompile
and pick up changes if you modify the script file
regards
deepak

On Wed, Mar 2, 2016 at 4:30 PM, Oliver Erlewein <ol...@erlewein.net> wrote:

> Hi all,
>
> I wonder if someone can shed some light on this.
>
> So, using Groovy JSR223 script that I load externally. The JMeter doco says
> I need not worry about the Cache key as that is implicit with external
> scripts. BUT I changed the script half way through the test and it
> immediately had an effect on the test. That to me says the script is not
> cached but loaded every time. Or is there some logic that looks for change?
>
> Short question would be " do I need to set the Cache key when loading
> external JSR223 Groovy scripts"?
>
> Cheers Oliver
>