jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1406343 - in /jmeter/trunk: src/components/org/apache/jmeter/assertions/ src/components/org/apache/jmeter/extractor/ src/components/org/apache/jmeter/modifiers/ src/components/org/apache/jmeter/timers/ src/components/org/apache/jmeter/visu...
Date Tue, 06 Nov 2012 21:25:26 GMT
Author: pmouawad
Date: Tue Nov  6 21:25:25 2012
New Revision: 1406343

URL: http://svn.apache.org/viewvc?rev=1406343&view=rev
Log:
Bug 54107 - JSR223TestElement : Enable compilation and caching of Script Text
Bugzilla Id: 54107

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources.properties
    jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources_fr.properties
    jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources.properties
    jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources_fr.properties
    jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources.properties
    jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources_fr.properties
    jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources.properties
    jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources_fr.properties
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources.properties
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources_fr.properties
    jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java
    jmeter/trunk/src/core/org/apache/jmeter/util/JSR223TestElement.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources.properties
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources_fr.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources.properties
Tue Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 Assertion
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources_fr.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=Assertion JSR223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier 
 filename.shortDescription=Fichier script (remplace le script)
 filenameGroup.displayName=Fichier script (remplace le script)

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources.properties
Tue Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 PostProcessor
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources_fr.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=Post-Processeur JSR223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier 
 filename.shortDescription=Fichier script (remplace le script)
 filenameGroup.displayName=Fichier script (remplace le script)

Modified: jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources.properties
Tue Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 PreProcessor
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources_fr.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=Pr\u00E9-Processeur JSR223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier 
 filename.shortDescription=Fichier script (remplace le script)
 filenameGroup.displayName=Fichier script (remplace le script)

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources.properties (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources.properties Tue
Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 Timer
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources_fr.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=Compteur de temps JSR223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier
 filename.shortDescription=Fichier script (remplace le code script)
 filenameGroup.displayName=Fichier script (remplace le code script)

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources.properties
Tue Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 Listener
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR 223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources_fr.properties
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=R\u00E9cepteur JSR 223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier 
 filename.shortDescription=Fichier script (remplace le script)
 filenameGroup.displayName=Fichier script (remplace le script)

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java Tue Nov  6 21:25:25
2012
@@ -18,6 +18,7 @@
 
 package org.apache.jmeter.util;
 
+import java.beans.PropertyDescriptor;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -29,6 +30,8 @@ import javax.script.ScriptEngineManager;
  * Parent class to handle common GUI design for JSR223 test elements
  */
 public abstract class JSR223BeanInfoSupport extends ScriptingBeanInfoSupport {
+    private static final String CACHE_KEY = "cacheKey";
+    private static final String CACHE_KEY_GROUP = "cacheKey_group";
 
     private static final String[] LANGUAGE_TAGS;
 
@@ -50,6 +53,13 @@ public abstract class JSR223BeanInfoSupp
 
     protected JSR223BeanInfoSupport(Class<?> beanClass) {
         super(beanClass, LANGUAGE_TAGS);
+        
+        createPropertyGroup(CACHE_KEY_GROUP, new String[] { 
+                CACHE_KEY });
+
+        PropertyDescriptor p = property(CACHE_KEY);
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, ""); // $NON-NLS-1$
     }
 
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JSR223TestElement.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JSR223TestElement.java?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JSR223TestElement.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JSR223TestElement.java Tue Nov  6 21:25:25
2012
@@ -40,6 +40,7 @@ import org.apache.commons.lang3.StringUt
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
 import org.apache.jmeter.testelement.AbstractTestElement;
+import org.apache.jmeter.testelement.TestStateListener;
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
@@ -48,7 +49,7 @@ import org.apache.jorphan.util.JOrphanUt
 import org.apache.log.Logger;
 
 public abstract class JSR223TestElement extends AbstractTestElement
-    implements Serializable, Cloneable
+    implements Serializable, Cloneable, TestStateListener
 {
     /**
      * Initialization On Demand Holder pattern
@@ -75,6 +76,7 @@ public abstract class JSR223TestElement 
 
     private String scriptLanguage; // JSR223 language to use
 
+    private String cacheKey = ""; // If not empty then script in ScriptText will be compiled
and cached
     /**
      * Cache of compiled scripts
      */
@@ -94,6 +96,7 @@ public abstract class JSR223TestElement 
         filename="";
         script="";
         scriptLanguage="";
+        cacheKey = "";
     }
 
     protected Object readResolve() {
@@ -211,7 +214,24 @@ public abstract class JSR223TestElement 
                 throw new ScriptException("Script file '"+scriptFile.getAbsolutePath()+"'
does not exist or is unreadable for element:"+getName());
             }
         } else if (!StringUtils.isEmpty(getScript())){
-            return scriptEngine.eval(getScript(), bindings);
+            if (supportsCompilable && !StringUtils.isEmpty(cacheKey)) {
+                CompiledScript compiledScript = 
+                        compiledScriptsCache.get(cacheKey);
+                if(compiledScript==null) {
+                    synchronized (compiledScriptsCache) {
+                        compiledScript = 
+                                compiledScriptsCache.get(cacheKey);
+                        if(compiledScript==null) {
+                            compiledScript = 
+                                    ((Compilable) scriptEngine).compile(getScript());
+                            compiledScriptsCache.put(cacheKey, compiledScript);
+                        }
+                    }
+                }
+                return compiledScript.eval(bindings);
+            } else {
+                return scriptEngine.eval(getScript(), bindings);
+            }
         } else {
             throw new ScriptException("Both script file and script text are empty for element:"+getName());
           
         }
@@ -263,4 +283,46 @@ public abstract class JSR223TestElement 
     public void setScriptLanguage(String s) {
         scriptLanguage = s;
     }
+
+    /**
+     * @return the cacheKey
+     */
+    public String getCacheKey() {
+        return cacheKey;
+    }
+
+    /**
+     * @param cacheKey the cacheKey to set
+     */
+    public void setCacheKey(String cacheKey) {
+        this.cacheKey = cacheKey;
+    }
+
+    /**
+     * @see org.apache.jmeter.testelement.TestStateListener#testStarted()
+     */
+    public void testStarted() {
+        // NOOP
+    }
+
+    /**
+     * @see org.apache.jmeter.testelement.TestStateListener#testStarted(java.lang.String)
+     */
+    public void testStarted(String host) {
+        // NOOP   
+    }
+
+    /**
+     * @see org.apache.jmeter.testelement.TestStateListener#testEnded()
+     */
+    public void testEnded() {
+        testEnded("");
+    }
+
+    /**
+     * @see org.apache.jmeter.testelement.TestStateListener#testEnded(java.lang.String)
+     */
+    public void testEnded(String host) {
+        compiledScriptsCache.clear();
+    }
 }
\ No newline at end of file

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources.properties
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources.properties
Tue Nov  6 21:25:25 2012
@@ -14,6 +14,9 @@
 #   limitations under the License.
 
 displayName=JSR223 Sampler
+cacheKey.displayName=Compilation cache key
+cacheKey.shortDescription=If Cache key is not empty, script will be compiled if JSR223 underlying
script language supports it and CompiledScript will be cached, ensure script does not use
any variable before making it cacheable
+cacheKey_group.displayName=Script compilation caching
 scriptingLanguage.displayName=Script language (e.g. beanshell, javascript, jexl)
 scriptLanguage.displayName=Language
 scriptLanguage.shortDescription=Name of JSR 223 language, e.g. beanshell, javascript, jexl

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources_fr.properties?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources_fr.properties
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223SamplerResources_fr.properties
Tue Nov  6 21:25:25 2012
@@ -15,6 +15,9 @@
 
 #Stored by I18NEdit, may be edited!
 displayName=Echantillon JSR223
+cacheKey.displayName=Clef de caching
+cacheKey.shortDescription=Si la clef de caching n'est pas vide, le script sera compil\u00E9
si le language sous-jacent JSR223 fournit cette fonctionnalit\u00E9 et l'objet CompiledScript
sera mis en cache, assurez vous avant d'utiliser ce caching que le script n'utilise pas de
variables JMeter
+cacheKey_group.displayName=Param\u00E8tres de caching du Script compil\u00E9
 filename.displayName=Nom de fichier
 filename.shortDescription=Fichier script (remplace le script)
 filenameGroup.displayName=Fichier script (remplace le script)

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Nov  6 21:25:25 2012
@@ -148,6 +148,7 @@ and right angle bracket (&gt;) in search
 <ul>
 <li><bugzilla>54004</bugzilla> - Webservice Sampler : Allow adding headers
to request with Header Manager</li>
 <li><bugzilla>54106</bugzilla> - JSR223TestElement should check for file
existence when a filename is set instead of using Text Area content </li>
+<li><bugzilla>54107</bugzilla> - JSR223TestElement : Enable compilation
and caching of Script Text</li>
 </ul>
 
 <h3>Controllers</h3>

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1406343&r1=1406342&r2=1406343&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Tue Nov  6 21:25:25 2012
@@ -1199,8 +1199,13 @@ Currently the only way to changes these 
 <p>
 The JSR223 Sampler allows JSR223 script code to be used to perform a sample.
 JSR223 related elements have a feature that increases highly their performances.
-To benefit from this feature use Script files instead of inlining them. This will make JMeter
compile them if this
-feature is available on ScriptEngine and cache them.
+To benefit from this feature:
+<ul>
+    <li>Use Script files instead of inlining them. This will make JMeter compile them
if this feature is available on ScriptEngine and cache them.</li>
+    <li>Use Script Text and fill in script cache key property, ensure it is unique
accross Test Plan as JMeter will use it to cache result of compilation.
+    <note>When using this feature, ensure you script code does not use JMeter variables
directly in script code as caching would only cache first replacement. Instead use script
parameters.</note>
+    </li>
+</ul>
 Cache size is controlled by the following jmeter property (jmeter.properties):
 <ul>
 <li>jsr223.compiled_scripts_cache_size=100</li>
@@ -1209,7 +1214,7 @@ For details, see <complink name="BSF Sam
 </p>
 <note>Unlike the BeanShell sampler, the interpreter is not saved between invocations.</note>
 <note>
-Since JMeter 2.8, JSR223 Test Elements using Script file are now Compiled if ScriptEngine
supports this feature, this enables great performance enhancements.
+Since JMeter 2.8, JSR223 Test Elements using Script file or Script text + cache key are now
Compiled if ScriptEngine supports this feature, this enables great performance enhancements.
 </note>
 </description>
 </component>



Mime
View raw message