Author: sebb
Date: Sun May 21 08:50:24 2006
New Revision: 408181

URL: http://svn.apache.org/viewvc?rev=408181&view=rev
Log:
Preload the START.* properties into variables

Modified:
    
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/threads/JMeterVariables.java
    jakarta/jmeter/branches/rel-2-1/xdocs/changes.xml
    jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml

Modified: 
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/threads/JMeterVariables.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/threads/JMeterVariables.java?rev=408181&r1=408180&r2=408181&view=diff
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/threads/JMeterVariables.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/threads/JMeterVariables.java
 Sun May 21 08:50:24 2006
@@ -23,6 +23,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.jmeter.util.JMeterUtils;
+
 /**
  * @version $Revision$
  */
@@ -30,10 +32,26 @@
        private Map variables = new HashMap();
 
        private int iteration = 0;
+    
+    // Property names to preload into JMeter variables:
+    private static final String [] PRE_LOAD = {
+      "START.MS", "START.YMD", "START.HMS"  
+    };
 
        public JMeterVariables() {
+        preloadVariables();
        }
 
+    private void preloadVariables(){
+        for (int i = 0; i<PRE_LOAD.length;i++){
+            String property=PRE_LOAD[i];
+            String value=JMeterUtils.getProperty(property);
+            if (value != null){
+                variables.put(property,value);
+            }
+        }
+    }
+
        public String getThreadName() {
                return Thread.currentThread().getName();
        }
@@ -46,8 +64,10 @@
                iteration++;
        }
 
+    // Does not appear to be used
        public void initialize() {
                variables.clear();
+        preloadVariables();
        }
 
        public Object remove(String key) {

Modified: jakarta/jmeter/branches/rel-2-1/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-1/xdocs/changes.xml?rev=408181&r1=408180&r2=408181&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/xdocs/changes.xml (original)
+++ jakarta/jmeter/branches/rel-2-1/xdocs/changes.xml Sun May 21 08:50:24 2006
@@ -95,7 +95,7 @@
 <li>Allow default HTTP implementation to be changed</li>
 <li>Optionally save active thread counts (group and all) to result files</li>
 <li>Variables/functions can now be used in Listener file names</li>
-<li>New __time() function; define START.MS/START.YMD/START.HMS properties</li>
+<li>New __time() function; define START.MS/START.YMD/START.HMS properties and 
variables</li>
 <li>Add Thread Name to Tree and Table Views</li>
 <li>Add debug functions: What class, debug on, debug off</li>
 <li>Non-caching Calculator - used by Table Visualiser to reduce memory 
footprint</li>

Modified: jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml?rev=408181&r1=408180&r2=408181&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml (original)
+++ jakarta/jmeter/branches/rel-2-1/xdocs/usermanual/functions.xml Sun May 21 
08:50:24 2006
@@ -689,6 +689,7 @@
 <p>
 Properties are defined in jmeter.properties, or on the command line.
 Some additional properties are defined by JMeter. These are listed below.
+The START properties are also copied to variables with the same names.
 </p>
 <ul>
 <li>START.MS - start time in milliseconds</li>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to