sebb 2005/03/13 16:54:43
Modified: src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
bin Tag: rel-2_0 jmeter.properties
Log:
Set Sampling started a bit earlier, so controllers have access to variables
and functions
Revision Changes Path
No revision
No revision
1.48.2.7 +24 -3
jakarta-jmeter/src/core/org/apache/jmeter/threads/JMeterThread.java
Index: JMeterThread.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/JMeterThread.java,v
retrieving revision 1.48.2.6
retrieving revision 1.48.2.7
diff -u -r1.48.2.6 -r1.48.2.7
--- JMeterThread.java 8 Mar 2005 22:49:41 -0000 1.48.2.6
+++ JMeterThread.java 14 Mar 2005 00:54:43 -0000 1.48.2.7
@@ -213,6 +213,21 @@
this.threadName = threadName;
}
+ /*
+ * See below for reason for this change.
+ * Just in case this causes problems, allow the change to be backed out
+ */
+ private static final boolean startEarlier =
+
org.apache.jmeter.util.JMeterUtils.getPropDefault("jmeterthread.startearlier",true);
+
+ static{
+ if (startEarlier){
+ log.warn("jmeterthread.startearlier=true (see
jmeter.properties)");
+ } else {
+ log.info("jmeterthread.startearlier=false (see
jmeter.properties)");
+ }
+ }
+
public void run()
{
try
@@ -235,9 +250,15 @@
rampUpDelay();
log.info("Thread " + Thread.currentThread().getName() + "
started");
+ /*
+ * Setting SamplingStarted before the contollers are
initialised
+ * allows them to access the running values of
functions and variables
+ * (however it does not seem to help with the
listeners)
+ */
+ if (startEarlier) threadContext.setSamplingStarted(true);
controller.initialize();
controller.addIterationListener(new IterationListener());
- threadContext.setSamplingStarted(true);
+ if (!startEarlier)
threadContext.setSamplingStarted(true);
threadStarted();
while (running)
{
No revision
No revision
1.100.2.13 +8 -2 jakarta-jmeter/bin/jmeter.properties
Index: jmeter.properties
===================================================================
RCS file: /home/cvs/jakarta-jmeter/bin/jmeter.properties,v
retrieving revision 1.100.2.12
retrieving revision 1.100.2.13
diff -u -r1.100.2.12 -r1.100.2.13
--- jmeter.properties 12 Mar 2005 11:38:40 -0000 1.100.2.12
+++ jmeter.properties 14 Mar 2005 00:54:43 -0000 1.100.2.13
@@ -320,4 +320,10 @@
# CookieManager behaviour - should cookies with null/empty values be deleted?
# Default is true. Use false to revert to original behaviour
-#CookieManager.delete_null_cookies=true
\ No newline at end of file
+#CookieManager.delete_null_cookies=true
+
+# (2.0.3) JMeterThread behaviour has been changed to set the started flag
before
+# the controllers are initialised. This is so controllers can access
variables earlier.
+# In case this causes problems, the previous behaviour can be restored by
uncommenting
+# the following line.
+#jmeterthread.startearlier=false
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]