Author: sebb
Date: Tue Dec 4 13:26:35 2007
New Revision: 601090
URL: http://svn.apache.org/viewvc?rev=601090&view=rev
Log:
Implement work-round to reduce classloading in non-GUI mode when scanning for
Function classes.
Modified:
jakarta/jmeter/trunk/bin/jmeter.properties
jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
jakarta/jmeter/trunk/xdocs/changes.xml
Modified: jakarta/jmeter/trunk/bin/jmeter.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=601090&r1=601089&r2=601090&view=diff
==============================================================================
--- jakarta/jmeter/trunk/bin/jmeter.properties (original)
+++ jakarta/jmeter/trunk/bin/jmeter.properties Tue Dec 4 13:26:35 2007
@@ -587,6 +587,17 @@
# the following line.
#jmeterengine.startlistenerslater=false
+#Should JMeter expand the tree when loading a test plan?
+#onload.expandtree=false
+
+# List of additional content types to be treated as text; separate entries
with commas.
+# If the content type begins with the same string, then it is treated as text.
+# The following example types are already allowed for:
+#content-type_text=text/,application/javascript,application/json,application/xhtml+xml
+
+#---------------------------------------------------------------------------
+# Classpath configuration
+#---------------------------------------------------------------------------
# List of paths (separated by ;) to search for additional JMeter extension jars
# These are in addition to lib/ext. Do not use this for utility jars.
@@ -597,13 +608,23 @@
# Paths with spaces may cause problems for the JVM
#user.classpath=../classes;../jars/jar1.jar
-#Should JMeter expand the tree when loading a test plan?
-#onload.expandtree=false
+# Classpath finder
+# ================
+# The classpath finder currently needs to load every single JMeter class to
find
+# the classes it needs.
+# For non-GUI mode, it's only necessary to scan for Function classes, but all
classes
+# are still loaded.
+# All current Function classes include ".function." in their name,
+# and none include ".gui." in the name, so the number of unwanted classes
loaded can be
+# reduced by checking for these. However, if a valid function class name does
not match
+# these restrictions, it will not be loaded. If problems are encountered, then
comment
+# or change the following properties:
+classfinder.functions.contain=.functions.
+classfinder.functions.notContain=.gui.
-# List of additional content types to be treated as text; separate entries
with commas.
-# If the content type begins with the same string, then it is treated as text.
-# The following example types are already allowed for:
-#content-type_text=text/,application/javascript,application/json,application/xhtml+xml
+#---------------------------------------------------------------------------
+# Additional property files to load
+#---------------------------------------------------------------------------
# Should JMeter automatically load additional JMeter properties?
# File name to look for (comment to disable)
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/util/CompoundVariable.java?rev=601090&r1=601089&r2=601090&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
Tue Dec 4 13:26:35 2007
@@ -58,8 +58,18 @@
static {
try {
+ final String contain = // Classnames must contain this
string [.functions.]
+
JMeterUtils.getProperty("classfinder.functions.contain"); // $NON-NLS-1$
+ final String notContain = // Classnames must not
contain this string [.gui.]
+
JMeterUtils.getProperty("classfinder.functions.notContain"); // $NON-NLS-1$
+ if (contain!=null){
+ log.info("Note: Function class names must
contain the string: '"+contain+"'");
+ }
+ if (notContain!=null){
+ log.info("Note: Function class names must not
contain the string: '"+notContain+"'");
+ }
List classes =
ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(),
- new Class[] { Function.class }, true);
+ new Class[] { Function.class }, true,
contain, notContain);
Iterator iter = classes.iterator();
while (iter.hasNext()) {
Function tempFunc = (Function)
Class.forName((String) iter.next()).newInstance();
Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=601090&r1=601089&r2=601090&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Tue Dec 4 13:26:35 2007
@@ -33,7 +33,13 @@
<h4>Incompatible changes</h4>
<ul>
-<li></li>
+<li>
+To reduce the number of classes loaded in non-GUI mode,
+Functions will only be found if their classname contains the string
+'.functions.' and does not contain the string '.gui.'.
+All existing JMeter functions conform to this restriction.
+To revert to earlier behaviour, comment or change the properties
classfinder.functions.* in jmeter.properties.
+</li>
</ul>
<h4>Bug fixes</h4>
@@ -53,6 +59,8 @@
<li>Bug 43984 - trim spaces from port field</li>
<li>Add optional comment to __log() function</li>
<li>Make Random function variable name optional</li>
+<li>Reduce class loading in non-GUI mode by only looking for Functions in
class names
+that contain '.functions.' and don't contain '.gui.'</li>
</ul>
<h4>Non-functional changes</h4>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]