cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2005-08-04 Thread sebb
sebb2005/08/04 14:15:21

  Modified:src/core/org/apache/jmeter/testelement
AbstractTestElement.java TestElement.java
   src/core/org/apache/jmeter/threads JMeterThread.java
  Added:   src/core/org/apache/jmeter/testelement ThreadListener.java
  Log:
  Implement ThreadListener interface
  (more efficient than scanning all elements)
  
  Revision  ChangesPath
  1.45  +0 -16 
jakarta-jmeter/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
  
  Index: AbstractTestElement.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/AbstractTestElement.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- AbstractTestElement.java  12 Jul 2005 20:50:28 -  1.44
  +++ AbstractTestElement.java  4 Aug 2005 21:15:21 -   1.45
  @@ -385,22 +385,6 @@
this.threadName = inthreadName;
}
   
  - /*
  -  * (non-Javadoc)
  -  * 
  -  * @see org.apache.jmeter.testelement.TestElement#threadFinished()
  -  */
  - public void threadFinished() {
  - }
  -
  - /*
  -  * (non-Javadoc)
  -  * 
  -  * @see org.apache.jmeter.testelement.TestElement#threadStarted()
  -  */
  - public void threadStarted() {
  - }
  -
/**
 * 
 */
  
  
  
  1.16  +2 -12 
jakarta-jmeter/src/core/org/apache/jmeter/testelement/TestElement.java
  
  Index: TestElement.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/testelement/TestElement.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TestElement.java  12 Jul 2005 20:50:28 -  1.15
  +++ TestElement.java  4 Aug 2005 21:15:21 -   1.16
  @@ -157,16 +157,6 @@
public void setThreadName(String threadName);
   
/**
  -  * Called at the start of each thread. TODO - should it hava a 
parameter?
  -  */
  - public void threadStarted();
  -
  - /**
  -  * Called at the end of each thread. TODO - should it hava a parameter?
  -  */
  - public void threadFinished();
  -
  - /**
 * Called by Remove to determine if it is safe to remove the element. 
The
 * element can either clean itself up, and return true, or the element 
can
 * return false.
  
  
  
  1.3   +33 -24
jakarta-jmeter/src/core/org/apache/jmeter/testelement/ThreadListener.java
  
  
  
  
  1.61  +29 -41
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.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- JMeterThread.java 12 Jul 2005 20:50:42 -  1.60
  +++ JMeterThread.java 4 Aug 2005 21:15:21 -   1.61
  @@ -36,9 +36,9 @@
   import org.apache.jmeter.testbeans.TestBeanHelper;
   import org.apache.jmeter.testelement.TestElement;
   import org.apache.jmeter.testelement.TestListener;
  +import org.apache.jmeter.testelement.ThreadListener;
   import org.apache.jmeter.timers.Timer;
   import org.apache.jorphan.collections.HashTree;
  -import org.apache.jorphan.collections.HashTreeTraverser;
   import org.apache.jorphan.collections.SearchByClass;
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.jorphan.util.JMeterStopTestException;
  @@ -74,9 +74,11 @@
   
private transient JMeterVariables threadVars;
   
  - private Collection testListeners;
  + private transient Collection testListeners;   // Elements that 
implement TestListener
   
  - private transient ListenerNotifier notifier;
  +private transient Collection threadListeners; // Elements that implement 
ThreadListener
  +
  +private transient ListenerNotifier notifier;
   
private int threadNum = 0;
   
  @@ -110,10 +112,16 @@
testTree = test;
compiler = new TestCompiler(testTree, threadVars);
controller = (Controller) testTree.getArray()[0];
  +
SearchByClass threadListenerSearcher = new 
SearchByClass(TestListener.class);
test.traverse(threadListenerSearcher);
testListeners = threadListenerSearcher.getSearchResults();
  - notifier = note;
  +
  +SearchByClass testListenerSearcher = new 
SearchByClass(ThreadListener.class);
  +test.traverse(testListenerSearcher);
  +threadListeners = testListenerSearcher.getSearchResults();
  + 
  +notifier = note;
running = true;
}
   
  @@ -337,49 +345,29 @@
threadStarted();
}
   
  - 

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2005-03-08 Thread sebb
sebb2005/03/08 14:49:41

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Make sure errors are logged
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.6  +8 -2  
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.5
  retrieving revision 1.48.2.6
  diff -u -r1.48.2.5 -r1.48.2.6
  --- JMeterThread.java 8 Oct 2004 20:59:03 -   1.48.2.5
  +++ JMeterThread.java 8 Mar 2005 22:49:41 -   1.48.2.6
  @@ -312,6 +312,12 @@
   {
   log.error("Test failed!", e);
   }
  + catch (ThreadDeath e){
  + throw e; // Must not ignore this one
  + }
  + catch (Error e){// Make sure errors are output to the log file
  + log.error("Test failed!", e);
  + }
   finally
   {
   threadContext.clear();
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-12-14 Thread mstover1
mstover12004/12/14 16:54:25

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  threads should increment the thread counter as soon as possible
  
  Revision  ChangesPath
  1.57  +3 -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.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- JMeterThread.java 13 Dec 2004 21:43:00 -  1.56
  +++ JMeterThread.java 15 Dec 2004 00:54:25 -  1.57
  @@ -218,6 +218,7 @@
   {
   try
   {
  +JMeterContextService.incrNumberOfThreads();
   threadContext = JMeterContextService.getContext();
   threadContext.setVariables(threadVars);
   threadContext.setThreadNum(getThreadNum());
  @@ -330,7 +331,6 @@
private void threadStarted() {
Traverser startup = new Traverser(true);
   testTree.traverse(startup);
  -JMeterContextService.incrNumberOfThreads();
}
   
   /**
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-10-08 Thread sebb
sebb2004/10/08 13:59:03

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Tidy up saving of sample results for while controller
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.5  +6 -9  
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.4
  retrieving revision 1.48.2.5
  diff -u -r1.48.2.4 -r1.48.2.5
  --- JMeterThread.java 6 Oct 2004 01:58:26 -   1.48.2.4
  +++ JMeterThread.java 8 Oct 2004 20:59:03 -   1.48.2.5
  @@ -82,7 +82,6 @@
   
   public static final String PACKAGE_OBJECT = "JMeterThread.pack"; // $NON-NLS-1$
   public static final String LAST_SAMPLE_OK = "JMeterThread.last_sample_ok"; // 
$NON-NLS-1$
  - public static final String ALL_SAMPLES_OK = "JMeterThread.all_samples_ok"; // 
$NON-NLS-1$
   
   public JMeterThread()
   {
  @@ -221,6 +220,8 @@
   threadContext = JMeterContextService.getContext();
   threadContext.setVariables(threadVars);
   threadContext.setThreadNum(getThreadNum());
  +// initialise
  +threadContext.getVariables().put(LAST_SAMPLE_OK,"true"); // $NON-NLS-1$
   testTree.traverse(compiler);
   running = true;
   //listeners = controller.getListeners();
  @@ -393,8 +394,6 @@
   private void checkAssertions(List assertions, SampleResult result)
   {
   Iterator iter = assertions.iterator();
  -boolean last_sample_ok=true;
  -boolean all_samples_ok=true;
   while (iter.hasNext())
   {
Assertion assertion= (Assertion)iter.next();
  @@ -404,11 +403,9 @@
   result.isSuccessful()
   && !(assertionResult.isError() || assertionResult.isFailure()));
   result.addAssertionResult(assertionResult);
  -last_sample_ok = result.isSuccessful();
  -all_samples_ok &= last_sample_ok;
   }
  -
threadContext.getVariables().put(LAST_SAMPLE_OK,JOrphanUtils.booleanToString(last_sample_ok));
  -
threadContext.getVariables().put(ALL_SAMPLES_OK,JOrphanUtils.booleanToString(all_samples_ok));
  +threadContext.getVariables().put(LAST_SAMPLE_OK,
  + JOrphanUtils.booleanToString(result.isSuccessful()));
   }
   
   private void runPostProcessors(List extractors)
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-10-05 Thread sebb
sebb2004/10/05 18:58:26

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Save sampler success states
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.4  +14 -5 
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.3
  retrieving revision 1.48.2.4
  diff -u -r1.48.2.3 -r1.48.2.4
  --- JMeterThread.java 13 Sep 2004 16:55:54 -  1.48.2.3
  +++ JMeterThread.java 6 Oct 2004 01:58:26 -   1.48.2.4
  @@ -44,6 +44,7 @@
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.jorphan.util.JMeterStopTestException;
   import org.apache.jorphan.util.JMeterStopThreadException;
  +import org.apache.jorphan.util.JOrphanUtils;
   import org.apache.log.Logger;
   
   /**
  @@ -64,8 +65,8 @@
   TestCompiler compiler;
   JMeterThreadMonitor monitor;
   String threadName;
  -JMeterContext threadContext;
  -JMeterVariables threadVars;
  +JMeterContext threadContext; // current working thread context
  +JMeterVariables threadVars;// Initial thread variables
   Collection testListeners;
   ListenerNotifier notifier;
   int threadNum = 0;
  @@ -79,7 +80,9 @@
private boolean onErrorStopTest;
private boolean onErrorStopThread;
   
  -public static final String PACKAGE_OBJECT = "JMeterThread.pack";
  +public static final String PACKAGE_OBJECT = "JMeterThread.pack"; // $NON-NLS-1$
  +public static final String LAST_SAMPLE_OK = "JMeterThread.last_sample_ok"; // 
$NON-NLS-1$
  + public static final String ALL_SAMPLES_OK = "JMeterThread.all_samples_ok"; // 
$NON-NLS-1$
   
   public JMeterThread()
   {
  @@ -390,6 +393,8 @@
   private void checkAssertions(List assertions, SampleResult result)
   {
   Iterator iter = assertions.iterator();
  +boolean last_sample_ok=true;
  +boolean all_samples_ok=true;
   while (iter.hasNext())
   {
Assertion assertion= (Assertion)iter.next();
  @@ -399,7 +404,11 @@
   result.isSuccessful()
   && !(assertionResult.isError() || assertionResult.isFailure()));
   result.addAssertionResult(assertionResult);
  +last_sample_ok = result.isSuccessful();
  +all_samples_ok &= last_sample_ok;
   }
  +
threadContext.getVariables().put(LAST_SAMPLE_OK,JOrphanUtils.booleanToString(last_sample_ok));
  +
threadContext.getVariables().put(ALL_SAMPLES_OK,JOrphanUtils.booleanToString(all_samples_ok));
   }
   
   private void runPostProcessors(List extractors)
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-09-13 Thread sebb
sebb2004/09/13 09:55:55

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Catch and log any remaining errors
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.3  +6 -2  
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.2
  retrieving revision 1.48.2.3
  diff -u -r1.48.2.2 -r1.48.2.3
  --- JMeterThread.java 13 Sep 2004 16:47:19 -  1.48.2.2
  +++ JMeterThread.java 13 Sep 2004 16:55:54 -  1.48.2.3
  @@ -304,6 +304,10 @@
{
log.info("Stop Thread seen: "+e.toString());
}
  +catch (Exception e)
  +{
  +log.error("Test failed!", e);
  +}
   finally
   {
   threadContext.clear();
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-09-13 Thread sebb
sebb2004/09/13 09:47:19

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Detect JMeterStopThread/Test in outer loop (e.g. when called from User Parameters)
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.2  +12 -2 
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.1
  retrieving revision 1.48.2.2
  diff -u -r1.48.2.1 -r1.48.2.2
  --- JMeterThread.java 22 Jun 2004 23:22:32 -  1.48.2.1
  +++ JMeterThread.java 13 Sep 2004 16:47:19 -  1.48.2.2
  @@ -294,6 +294,16 @@
   }
   }
   }
  +// Might be found by contoller.next()
  +catch (JMeterStopTestException e)
  + {
  + log.info("Stopping Test: "+e.toString());
  + stopTest();
  + }
  +catch (JMeterStopThreadException e)
  + {
  + log.info("Stop Thread seen: "+e.toString());
  + }
   finally
   {
   threadContext.clear();
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-06-22 Thread sebb
sebb2004/06/22 16:22:32

  Modified:src/core/org/apache/jmeter/threads Tag: rel-2_0
JMeterThread.java
  Log:
  Detect StopTest/Thread exceptions and handle gracefully
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.48.2.1  +14 -2 
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
  retrieving revision 1.48.2.1
  diff -u -r1.48 -r1.48.2.1
  --- JMeterThread.java 27 Feb 2004 00:17:06 -  1.48
  +++ JMeterThread.java 22 Jun 2004 23:22:32 -  1.48.2.1
  @@ -42,6 +42,8 @@
   import org.apache.jorphan.collections.HashTreeTraverser;
   import org.apache.jorphan.collections.SearchByClass;
   import org.apache.jorphan.logging.LoggingManager;
  +import org.apache.jorphan.util.JMeterStopTestException;
  +import org.apache.jorphan.util.JMeterStopThreadException;
   import org.apache.log.Logger;
   
   /**
  @@ -271,6 +273,16 @@
   }
   
   }
  +catch (JMeterStopTestException e)
  + {
  + log.info("Stopping Test: "+e.toString());
  + stopTest();
  + }
  +catch (JMeterStopThreadException e)
  + {
  + log.info("Stopping Thread: "+e.toString());
  + stopThread();
  + }
   catch (Exception e)
   {
   log.error("", e);
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-06-06 Thread sebb
sebb2004/06/06 15:18:27

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Reduce visibility of fields
  
  Revision  ChangesPath
  1.53  +16 -16
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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- JMeterThread.java 28 May 2004 21:09:12 -  1.52
  +++ JMeterThread.java 6 Jun 2004 22:18:27 -   1.53
  @@ -54,21 +54,21 @@
   public class JMeterThread implements Runnable, java.io.Serializable
   {
   transient private static Logger log = LoggingManager.getLoggerForClass();
  -static Map samplers = new HashMap();
  -int initialDelay = 0;
  -Controller controller;
  +private static Map samplers = new HashMap();
  +private int initialDelay = 0;
  +private Controller controller;
   private boolean running;
  -HashTree testTree;
  -TestCompiler compiler;
  -JMeterThreadMonitor monitor;
  -String threadName;
  -JMeterContext threadContext;
  -JMeterVariables threadVars;
  -Collection testListeners;
  -ListenerNotifier notifier;
  -int threadNum = 0;
  -long startTime = 0; 
  -long endTime = 0;
  +private HashTree testTree;
  +private transient TestCompiler compiler;
  +private JMeterThreadMonitor monitor;
  +private String threadName;
  +private transient JMeterContext threadContext;
  +private transient JMeterVariables threadVars;
  +private Collection testListeners;
  +private transient ListenerNotifier notifier;
  +private int threadNum = 0;
  +private long startTime = 0; 
  +private long endTime = 0;
   private boolean scheduler = false;
   //based on this scheduler is enabled or disabled
   
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-04-22 Thread thads
thads   2004/04/22 09:18:24

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Fixed an exception that occurs if a sampler returns null 

  when sample is called (for TestAction)
  
  Revision  ChangesPath
  1.50  +16 -13
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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- JMeterThread.java 8 Apr 2004 18:40:08 -   1.49
  +++ JMeterThread.java 22 Apr 2004 16:18:24 -  1.50
  @@ -253,17 +253,20 @@
   sampler.setThreadName(threadName);
   if (sampler instanceof TestBean) 
((TestBean)sampler).prepare();   
   SampleResult result = sampler.sample(null); // TODO: remove 
this useless Entry parameter
  -result.setThreadName(threadName);
  -threadContext.setPreviousResult(result);
  -runPostProcessors(pack.getPostProcessors());
  -checkAssertions(pack.getAssertions(), result);
  -notifyListeners(pack.getSampleListeners(), result);
  -compiler.done(pack);
  -if (result.isStopThread() || (!result.isSuccessful() && 
onErrorStopThread)){
  - stopThread();
  -}
  -if (result.isStopTest() || (!result.isSuccessful() && 
onErrorStopTest)){
  - stopTest();
  +if (result != null)
  +{
  + result.setThreadName(threadName);
  + threadContext.setPreviousResult(result);
  + runPostProcessors(pack.getPostProcessors());
  + checkAssertions(pack.getAssertions(), result);
  + notifyListeners(pack.getSampleListeners(), result);
  + compiler.done(pack);
  + if (result.isStopThread() || (!result.isSuccessful() 
&& onErrorStopThread)){
  + stopThread();
  + }
  + if (result.isStopTest() || (!result.isSuccessful() && 
onErrorStopTest)){
  + stopTest();
  + }
   }
   if (scheduler)
   {
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-02-26 Thread sebb
sebb2004/02/26 16:17:07

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Implement threadStarted/threadFinished method calls
  
  Revision  ChangesPath
  1.48  +51 -2 
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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JMeterThread.java 22 Feb 2004 19:13:41 -  1.47
  +++ JMeterThread.java 27 Feb 2004 00:17:06 -  1.48
  @@ -39,6 +39,7 @@
   import org.apache.jmeter.testelement.TestListener;
   import org.apache.jmeter.timers.Timer;
   import org.apache.jorphan.collections.HashTree;
  +import org.apache.jorphan.collections.HashTreeTraverser;
   import org.apache.jorphan.collections.SearchByClass;
   import org.apache.jorphan.logging.LoggingManager;
   import org.apache.log.Logger;
  @@ -231,6 +232,7 @@
   controller.initialize();
   controller.addIterationListener(new IterationListener());
   threadContext.setSamplingStarted(true);
  +threadStarted();
   while (running)
   {
   Sampler sam;
  @@ -285,7 +287,54 @@
   threadContext.clear();
   log.info("Thread " + threadName + " is done");
   monitor.threadFinished(this);
  +threadFinished();
   }
  +}
  +
  + /**
  +  * 
  +  */
  + private void threadStarted() {
  + Traverser startup = new Traverser(true);
  +testTree.traverse(startup);
  + }
  +
  +/**
  +  * 
  +  */
  + private void threadFinished() {
  + Traverser shut = new Traverser(false);
  +testTree.traverse(shut);
  + }
  +
  +private class Traverser implements HashTreeTraverser
  +{
  +private boolean isStart = false;
  +private Traverser(boolean start)
  +{
  +isStart = start;
  +}
  + public void addNode(Object node, HashTree subTree) {
  + if (node instanceof TestElement) {
  + TestElement te = (TestElement) node;
  + if (isStart)
  + {
  + te.threadStarted();
  + }
  + else
  + {
  + te.threadFinished();
  + }
  + }
  + }
  +
  + public void subtractNode() 
  + {
  + }
  +
  + public void processPath()
  + {
  + }
   }
   
   public String getThreadName()
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-02-22 Thread sebb
sebb2004/02/22 11:13:41

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Set context and ThreadName
  
  Revision  ChangesPath
  1.47  +4 -2  
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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- JMeterThread.java 13 Feb 2004 02:21:39 -  1.46
  +++ JMeterThread.java 22 Feb 2004 19:13:41 -  1.47
  @@ -246,6 +246,8 @@
   
   delay(pack.getTimers());
   Sampler sampler= pack.getSampler();
  +sampler.setThreadContext(threadContext);
  +sampler.setThreadName(threadName);
   if (sampler instanceof TestBean) 
((TestBean)sampler).prepare();   
   SampleResult result = sampler.sample(null); // TODO: remove 
this useless Entry parameter
   result.setThreadName(threadName);
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java TestCompiler.java

2004-01-16 Thread jsalvata
jsalvata2004/01/16 03:05:33

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
TestCompiler.java
  Log:
  Call prepare() from the engine on TestBean Samplers,
  Assertions, PreProcessors, and PostProcessors.
  
  Revision  ChangesPath
  1.45  +11 -7 
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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- JMeterThread.java 16 Jan 2004 09:28:28 -  1.44
  +++ JMeterThread.java 16 Jan 2004 11:05:33 -  1.45
  @@ -280,8 +280,10 @@
   //Hack: save the package for any transaction controllers
   threadContext.getVariables().putObject(PACKAGE_OBJECT,pack);
   
  -delay(pack.getTimers());
  -SampleResult result = pack.getSampler().sample(null);
  +delay(pack.getTimers());
  +Sampler sampler= pack.getSampler();
  +if (sampler instanceof TestBean) 
((TestBean)sampler).prepare();   
  +SampleResult result = sampler.sample(null); // TODO: remove 
this useless Entry parameter
   result.setThreadName(threadName);
   threadContext.setPreviousResult(result);
   runPostProcessors(pack.getPostProcessors());
  @@ -349,12 +351,13 @@
   Iterator iter = assertions.iterator();
   while (iter.hasNext())
   {
  -AssertionResult assertion =
  -((Assertion) iter.next()).getResult(result);
  + Assertion assertion= (Assertion)iter.next();
  + if (assertion instanceof TestBean) ((TestBean)assertion).prepare();
  +AssertionResult assertionResult = assertion.getResult(result);
   result.setSuccessful(
   result.isSuccessful()
  -&& !(assertion.isError() || assertion.isFailure()));
  -result.addAssertionResult(assertion);
  +&& !(assertionResult.isError() || assertionResult.isFailure()));
  +result.addAssertionResult(assertionResult);
   }
   }
   
  @@ -364,6 +367,7 @@
   while (iter.hasPrevious())
   {
   PostProcessor ex = (PostProcessor) iter.previous();
  +if (ex instanceof TestBean) ((TestBean)ex).prepare();
   ex.process();
   }
   }
  
  
  
  1.37  +10 -5 
jakarta-jmeter/src/core/org/apache/jmeter/threads/TestCompiler.java
  
  Index: TestCompiler.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/TestCompiler.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- TestCompiler.java 22 Oct 2003 10:28:07 -  1.36
  +++ TestCompiler.java 16 Jan 2004 11:05:33 -  1.37
  @@ -22,6 +22,7 @@
   import org.apache.jmeter.samplers.SampleListener;
   import org.apache.jmeter.samplers.SampleResult;
   import org.apache.jmeter.samplers.Sampler;
  +import org.apache.jmeter.testbeans.TestBean;
   import org.apache.jmeter.testelement.AbstractTestElement;
   import org.apache.jmeter.testelement.TestElement;
   import org.apache.jmeter.timers.Timer;
  @@ -105,9 +106,13 @@
   while (iter.hasNext())
   {
   PreProcessor ex = (PreProcessor) iter.next();
  -log.debug(
  -"Running preprocessor: "
  -+ ((AbstractTestElement) ex).getName());
  +if (log.isDebugEnabled())
  +{
  + log.debug(
  + "Running preprocessor: "
  + + ((AbstractTestElement) ex).getName());
  +}
  + if (ex instanceof TestBean) ((TestBean)ex).prepare();
   ex.process();
   }
   }
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-01-15 Thread sebb
sebb2004/01/15 19:04:36

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Hack: save the SamplePackage for use by Transaction Controllers
  
  Revision  ChangesPath
  1.43  +6 -1  
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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- JMeterThread.java 13 Jan 2004 12:32:23 -  1.42
  +++ JMeterThread.java 16 Jan 2004 03:04:36 -  1.43
  @@ -111,6 +111,7 @@
private boolean onErrorStopTest;
private boolean onErrorStopThread;
   
  +public static final String PACKAGE_OBJECT = "JMeterThread.pack";
   
   public JMeterThread()
   {
  @@ -274,6 +275,10 @@
   {
   threadContext.setCurrentSampler(sam);
   SamplePackage pack = compiler.configureSampler(sam);
  +
  +//Hack: save the package for any transaction controllers
  +threadContext.getVariables().putObject(PACKAGE_OBJECT,pack);
  +
   delay(pack.getTimers());
   SampleResult result = pack.getSampler().sample(null);
   result.setThreadName(threadName);
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2004-01-13 Thread sebb
sebb2004/01/13 04:32:23

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  See bug 26007 - ramp up needs to be after schedule start
  
  Revision  ChangesPath
  1.42  +4 -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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- JMeterThread.java 20 Dec 2003 00:57:58 -  1.41
  +++ JMeterThread.java 13 Jan 2004 12:32:23 -  1.42
  @@ -252,14 +252,15 @@
   testTree.traverse(compiler);
   running = true;
   //listeners = controller.getListeners();
  -rampUpDelay();
  -
  +
   if (scheduler)
   {
   //set the scheduler to start
   startScheduler();
   }
   
  + rampUpDelay();
  +
   log.info("Thread " + Thread.currentThread().getName() + " started");
   controller.initialize();
   controller.addIterationListener(new IterationListener());
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2003-12-19 Thread sebb
sebb2003/12/19 16:57:58

  Modified:src/core/org/apache/jmeter/reporters ResultCollector.java
   src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Remove code to set sampler timestamp
  
  Revision  ChangesPath
  1.29  +1 -2  
jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultCollector.java
  
  Index: ResultCollector.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/reporters/ResultCollector.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ResultCollector.java  19 Oct 2003 22:27:49 -  1.28
  +++ ResultCollector.java  20 Dec 2003 00:57:58 -  1.29
  @@ -389,7 +389,6 @@
   public void sampleOccurred(SampleEvent e)
   {
   SampleResult result = e.getResult();
  -result.setTimeStamp(System.currentTimeMillis());
   
   if (!isErrorLogging() || !result.isSuccessful())
   {
  
  
  
  1.41  +1 -2  
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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- JMeterThread.java 22 Nov 2003 03:25:25 -  1.40
  +++ JMeterThread.java 20 Dec 2003 00:57:58 -  1.41
  @@ -276,7 +276,6 @@
   delay(pack.getTimers());
   SampleResult result = pack.getSampler().sample(null);
   result.setThreadName(threadName);
  -result.setTimeStamp(System.currentTimeMillis());
   threadContext.setPreviousResult(result);
   runPostProcessors(pack.getPostProcessors());
   checkAssertions(pack.getAssertions(), result);
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2003-10-23 Thread sebb
sebb2003/10/23 06:04:18

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Start run if start time has passed; make scheduler methods private
  
  Revision  ChangesPath
  1.39  +4 -9  
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.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- JMeterThread.java 20 Oct 2003 23:57:24 -  1.38
  +++ JMeterThread.java 23 Oct 2003 13:04:18 -  1.39
  @@ -208,7 +208,7 @@
*
* author T.Elanjchezhiyan([EMAIL PROTECTED])
*/
  -public void stopScheduler()
  +private void stopScheduler()
   {
   long delay = System.currentTimeMillis() - endTime;
   if ((delay >= 0))
  @@ -218,27 +218,22 @@
   }
   
   /**
  - * Start the scheduler with the specified time
  + * Wait until the scheduled start time if necessary
*
* Author T.Elanjchezhiyan([EMAIL PROTECTED])
*/
  -public void startScheduler()
  +private void startScheduler()
   {
   long delay = (startTime - System.currentTimeMillis());
   if (delay > 0)
   {
   try
   {
  -running = true;
   Thread.sleep(delay);
   }
   catch (Exception e)
   {
   }
  -}
  -else
  -{
  -running = false;
   }
   }
   
  
  
  

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



cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2003-10-04 Thread sebb
sebb2003/10/04 17:10:33

  Modified:src/core/org/apache/jmeter/samplers SampleResult.java
   src/core/org/apache/jmeter/engine StandardJMeterEngine.java
   src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Implementing stop thread and stop test functionality
  
  Revision  ChangesPath
  1.12  +39 -5 
jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java
  
  Index: SampleResult.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SampleResult.java 2 Oct 2003 19:18:42 -   1.11
  +++ SampleResult.java 5 Oct 2003 00:10:33 -   1.12
  @@ -62,15 +62,15 @@
   
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.jmeter.assertions.AssertionResult;
  -import org.apache.jorphan.logging.LoggingManager;
  -import org.apache.log.Logger;
  +//import org.apache.jorphan.logging.LoggingManager;
  +//import org.apache.log.Logger;
   
   /**
* This is a nice packaging for the various information returned from taking a
* sample of an entry.
*
  - * @author $Author$
  - * @version$Revision$
  + * @author mstover?
  + * @version$Revision$ $Date$
*/
   public class SampleResult implements Serializable
   {
  @@ -107,10 +107,12 @@
   private Set files;
   private String dataEncoding;
   private long time;
  +private boolean stopThread = false; //Should thread terminate?
  + private boolean stopTest = false;   //Should test terminate?
   
   private final static String TOTAL_TIME = "totalTime";
   
  -transient private static Logger log = LoggingManager.getLoggerForClass();
  +//transient private static Logger log = LoggingManager.getLoggerForClass();
   
   public void setMarked(String filename)
   {
  @@ -346,4 +348,36 @@
   {
   this.dataEncoding = dataEncoding;
   }
  +/**
  + * @return
  + */
  +public boolean isStopTest()
  +{
  +return stopTest;
  +}
  +
  +/**
  + * @return
  + */
  +public boolean isStopThread()
  +{
  +return stopThread;
  +}
  +
  +/**
  + * @param b
  + */
  +public void setStopTest(boolean b)
  +{
  +stopTest = b;
  +}
  +
  +/**
  + * @param b
  + */
  +public void setStopThread(boolean b)
  +{
  +stopThread = b;
  +}
  +
   }
  
  
  
  1.32  +15 -3 
jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
  
  Index: StandardJMeterEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- StandardJMeterEngine.java 7 Sep 2003 18:54:53 -   1.31
  +++ StandardJMeterEngine.java 5 Oct 2003 00:10:33 -   1.32
  @@ -316,7 +316,8 @@
   group.getName() + (groupCount++) + "-" + (i + 1));
   
   scheduleThread(threads[i], group);
  -
  +
  +threads[i].setEngine(this);
   Thread newThread = new Thread(threads[i]);
   newThread.setName(threads[i].getThreadName());
   allThreads.put(threads[i], newThread);
  @@ -408,5 +409,16 @@
   }
   }
   }
  +
  + public void askThreadsToStop()
  + {
  + Iterator iter = new HashSet(allThreads.keySet()).iterator();
  + while (iter.hasNext())
  + {
  + JMeterThread item = (JMeterThread) iter.next();
  + item.stop();
  + }
  + }
  +
   
   }
  
  
  
  1.35  +34 -5 
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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- JMeterThread.java 7 Sep 2003 18:54:54 -   1.34
  +++ JMeterThread.java 5 Oct 2003 00:10:33 -   1.35
  @@ -63,6 +63,7 @@
   import org.apache.jmeter.assertions.Assertion;
   import org.apache.jmeter.assertions.AssertionResult;
   import org.apache.jmeter.control.Controller;
  +import org.apache.jmeter.engine.StandardJMeterEngine;
   import org.apache.jmeter.engine.event.LoopIterationEvent;
   import org.apache.jmeter.engine.event.LoopIterationListener;
   import org.apache.jmeter.processor.PostProcessor;
  @@ -90,7 +91,7 @@
   static Map samplers = new HashMap();
   int initialDelay = 0;
   Controller controller;
  -private b

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2003-05-29 Thread mstover1
mstover12003/05/29 06:33:57

  Modified:src/components/org/apache/jmeter/modifiers/gui
UserParametersGui.java
   src/core/org/apache/jmeter/gui
AbstractJMeterGuiComponent.java GuiPackage.java
JMeterGUIComponent.java NamePanel.java
   src/core/org/apache/jmeter/gui/action ActionRouter.java
   src/core/org/apache/jmeter/gui/tree JMeterTreeNode.java
   src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  no message
  
  Revision  ChangesPath
  1.11  +4 -5  
jakarta-jmeter/src/components/org/apache/jmeter/modifiers/gui/UserParametersGui.java
  
  Index: UserParametersGui.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/modifiers/gui/UserParametersGui.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- UserParametersGui.java12 May 2003 15:20:17 -  1.10
  +++ UserParametersGui.java29 May 2003 13:33:56 -  1.11
  @@ -1,7 +1,6 @@
   package org.apache.jmeter.modifiers.gui;
   
   import java.awt.BorderLayout;
  -import java.awt.Dimension;
   import java.awt.GridLayout;
   import java.awt.event.ActionEvent;
   import java.awt.event.ActionListener;
  @@ -132,11 +131,11 @@
new JLabel(JMeterUtils.getResString("user_parameters_table"));
initTableModel();
paramTable = new JTable(tableModel);
  - paramTable.setRowSelectionAllowed(true);
  - paramTable.setColumnSelectionAllowed(true);
  + //paramTable.setRowSelectionAllowed(true);
  + //paramTable.setColumnSelectionAllowed(true);
paramTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  - paramTable.setCellSelectionEnabled(true);
  -paramTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
  + //paramTable.setCellSelectionEnabled(true);
  +//paramTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
   
   JPanel paramPanel = new JPanel(new BorderLayout());
   paramPanel.add(tableLabel, BorderLayout.NORTH);
  
  
  
  1.21  +7 -1  
jakarta-jmeter/src/core/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
  
  Index: AbstractJMeterGuiComponent.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- AbstractJMeterGuiComponent.java   8 May 2003 22:04:16 -   1.20
  +++ AbstractJMeterGuiComponent.java   29 May 2003 13:33:56 -  1.21
  @@ -203,6 +203,12 @@
   enabled = element.getPropertyAsBoolean(TestElement.ENABLED);
   }
   }
  +
  +public void clear()
  +{
  +setName(getStaticLabel());
  +enabled = true;
  +}
   
   /**
* This provides a convenience for extenders when they implement the
  
  
  
  1.14  +2 -1  jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java
  
  Index: GuiPackage.java
  ===
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- GuiPackage.java   12 May 2003 21:31:06 -  1.13
  +++ GuiPackage.java   29 May 2003 13:33:56 -  1.14
  @@ -272,6 +272,7 @@
   try
   {
   JMeterGUIComponent comp = getGuiFromCache(guiClass);
  +comp.clear();
   TestElement node = comp.createTestElement();
   nodesToGui.put(node, comp);
   return node;
  
  
  
  1.9   +7 -1  
jakarta-jmeter/src/core/org/apache/jmeter/gui/JMeterGUIComponent.java
  
  Index: JMeterGUIComponent.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/JMeterGUIComponent.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JMeterGUIComponent.java   8 May 2003 22:04:16 -   1.8
  +++ JMeterGUIComponent.java   29 May 2003 13:33:56 -  1.9
  @@ -178,4 +178,10 @@
* Sets the tree node which this component is associated with.
* 
 * @param node the tree node corresponding to this component
 */
   void setNode(JMeterTreeNode node);
  +
  +/**
  + * Clear the gui and return it to initial default values.
  + * TODO: implement this in all gui classes.
  + */
  +public void clear();
   }
  
  
  
  1.11  +6 -1  jakarta-jmeter/src/core/org/apache/jmeter/gui/NamePanel.java
  
  Index: NamePanel.java
  

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java ListenerNotifier.java

2003-03-26 Thread mstover1
mstover12003/03/26 07:19:23

  Modified:bin  jmeter.properties
   src/components/org/apache/jmeter/visualizers
GraphVisualizer.java SplineVisualizer.java
StatVisualizer.java TableVisualizer.java
   src/core/org/apache/jmeter/engine StandardJMeterEngine.java
   src/core/org/apache/jmeter/threads JMeterThread.java
ListenerNotifier.java
  Log:
  Changing listener notifier to not use a separate thread.  Is simpler this way, and 
somewhat faster.  Fixed some synchronization issues in visualizers
  
  Revision  ChangesPath
  1.61  +1 -0  jakarta-jmeter/bin/jmeter.properties
  
  Index: jmeter.properties
  ===
  RCS file: /home/cvs/jakarta-jmeter/bin/jmeter.properties,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- jmeter.properties 18 Mar 2003 21:36:01 -  1.60
  +++ jmeter.properties 26 Mar 2003 15:19:22 -  1.61
  @@ -78,6 +78,7 @@
   log_level.jmeter.protocol.ftp=WARN
   log_level.jmeter.protocol.jdbc=WARN
   log_level.jmeter.protocol.java=WARN
  +log_leve.jmeter.elements.properties=WARN
   log_level.jorphan=ERROR
   
   #Log file for log messages.
  
  
  
  1.8   +3 -3  
jakarta-jmeter/src/components/org/apache/jmeter/visualizers/GraphVisualizer.java
  
  Index: GraphVisualizer.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/GraphVisualizer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GraphVisualizer.java  7 Feb 2003 04:18:53 -   1.7
  +++ GraphVisualizer.java  26 Mar 2003 15:19:23 -  1.8
  @@ -142,7 +142,7 @@
   /
* !ToDo (Method description)
***/
  -public void updateGui()
  +public synchronized void updateGui()
   {
   graph.updateGui();
   noSamplesField.setText(Long.toString(model.getSampleCount()));
  @@ -159,7 +159,7 @@
*
[EMAIL PROTECTED] s  !ToDo (Parameter description)
***/
  -public void updateGui(Sample s)
  +public synchronized void updateGui(Sample s)
   {
   // We have received one more sample
   graph.updateGui(s);
  
  
  
  1.6   +14 -16
jakarta-jmeter/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java
  
  Index: SplineVisualizer.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SplineVisualizer.java 3 Feb 2003 14:29:00 -   1.5
  +++ SplineVisualizer.java 26 Mar 2003 15:19:23 -  1.6
  @@ -54,7 +54,6 @@
*/
   package org.apache.jmeter.visualizers;
   
  -
   import java.awt.BorderLayout;
   import java.awt.Color;
   import java.awt.Dimension;
  @@ -76,7 +75,6 @@
   import org.apache.jmeter.visualizers.gui.AbstractVisualizer;
   import org.apache.jorphan.gui.layout.VerticalLayout;
   
  -
   /
* This class implements a statistical analyser that takes samples to process a
* Spline interpolated curve. Currently, it tries to look mostly like the
  @@ -86,8 +84,7 @@
[EMAIL PROTECTED]   $Date$
[EMAIL PROTECTED]   0.9.1
***/
  -public class SplineVisualizer extends AbstractVisualizer implements ImageVisualizer,
  -GraphListener, Clearable
  +public class SplineVisualizer extends AbstractVisualizer implements 
ImageVisualizer, GraphListener, Clearable
   {
   
   /
  @@ -276,10 +273,13 @@
   public void updateGui()
   {
   repaint();
  -setMinimum(model.getMinimum());
  -setMaximum(model.getMaximum());
  -setAverage(model.getAverage());
  -setIncoming(model.getCurrent());
  +synchronized (this)
  +{
  +setMinimum(model.getMinimum());
  +setMaximum(model.getMaximum());
  +setAverage(model.getAverage());
  +setIncoming(model.getCurrent());
  +}
   }
   
   /
  @@ -454,8 +454,7 @@
   g.setColor(this.getBackground());
   g.fillRect(0, 0, width, height);
   g.setColor(WAITING_COLOR);
  -
g.drawString(JMeterUtils.getResString("spline_visualizer_waitingmessage"),
  -(width - 120) / 2, height - (height - 12) / 2);
  +
g.drawString(JMeterUtils.getResString("spline_visualizer_waitingmessage"), (width - 
1

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java ListenerNotifier.java TestCompiler.java

2003-01-22 Thread mstover1
mstover12003/01/22 14:51:37

  Modified:src/core/org/apache/jmeter/threads JMeterThread.java
ListenerNotifier.java TestCompiler.java
  Log:
  Attempting a fix for guy with 4 proc remote jmeter machine running out of memory
  
  Revision  ChangesPath
  1.13  +3 -2  
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JMeterThread.java 13 Dec 2002 21:37:28 -  1.12
  +++ JMeterThread.java 22 Jan 2003 22:51:36 -  1.13
  @@ -223,6 +223,7 @@
new SampleEvent(result, (String) 
controller.getProperty(TestElement.NAME));
compiler.sampleOccurred(event);
notifier.addLast(event,listeners);
  + 
}
public void setInitialDelay(int delay) {
initialDelay = delay;
  
  
  
  1.9   +23 -9 
jakarta-jmeter/src/core/org/apache/jmeter/threads/ListenerNotifier.java
  
  Index: ListenerNotifier.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/ListenerNotifier.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ListenerNotifier.java 17 Oct 2002 19:47:17 -  1.8
  +++ ListenerNotifier.java 22 Jan 2003 22:51:36 -  1.9
  @@ -23,6 +23,8 @@
 */
boolean running;
boolean isStopped;
  + static private int ABS_MAX = 500;
  + static private int MAX = 200;
int sleepTime = 2000;
public ListenerNotifier()
{
  @@ -39,11 +41,7 @@
if (res != null)
{
List listeners = (List) this.removeFirst();
  - iter = listeners.iterator();
  - while (iter.hasNext())
  - {
  - ((SampleListener) 
iter.next()).sampleOccurred(res);
  - }
  + notifyListeners(res, listeners);
}
try
{
  @@ -52,7 +50,7 @@
catch (InterruptedException e)
{
}
  - if (size() > 200 && Thread.currentThread().getPriority() == 
Thread.NORM_PRIORITY)
  + if (size() > MAX && Thread.currentThread().getPriority() == 
Thread.NORM_PRIORITY)
{
log.debug("Notifier thread priority going from normal 
to max, size = "+size());

Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
  @@ -61,15 +59,31 @@
log.debug("Listener Notifier stopped");
isStopped = true;
}
  + private void notifyListeners(SampleEvent res, List listeners)
  + {
  + Iterator iter;
  + iter = listeners.iterator();
  + while (iter.hasNext())
  + {
  + ((SampleListener) iter.next()).sampleOccurred(res);
  + }
  + }
public boolean isStopped()
{
return isStopped;
}
public synchronized void addLast(SampleEvent item, List listeners)
{
  - super.addLast(item);
  - super.addLast(listeners);
  - sleepTime = 0;
  + if(size() > ABS_MAX)
  + {
  + notifyListeners(item,listeners);
  + }
  + else
  + {
  + super.addLast(item);
  + super.addLast(listeners);
  + sleepTime = 0;
  + }
}
public synchronized Object removeFirst()
{
  
  
  
  1.12  +9 -10 
jakarta-jmeter/src/core/org/apache/jmeter/threads/TestCompiler.java
  
  Index: TestCompiler.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/TestCompiler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TestCompiler.java 29 Dec 2002 14:20:57 -  1.11
  +++ TestCompiler.java 22 Jan 2003 22:51:36 -  1.12
  @@ -9,7 +9,6 @@
   import java.util.Set;
   
   import org.apache.jmeter.assertions.Assertion;
  -import org.apache.jmeter.config.Arguments;
   import org.apache.jmeter.config.ConfigTestElement;
   import org.apache.jmeter.config.Modifier;
   import org.apache.jmeter.config.ResponseBasedModifier;
  @@ -24,11 +23,11 @@
   import org.apache.jmeter.testeleme

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java ThreadGroup.java

2002-12-13 Thread mstover1
mstover12002/12/13 13:37:28

  Modified:src/components/org/apache/jmeter/control
GenericController.java
   src/core/org/apache/jmeter/control Controller.java
   src/core/org/apache/jmeter/threads JMeterThread.java
ThreadGroup.java
  Log:
  Fixing bug in thread iteration management
  
  Revision  ChangesPath
  1.2   +10 -1 
jakarta-jmeter/src/components/org/apache/jmeter/control/GenericController.java
  
  Index: GenericController.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/control/GenericController.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GenericController.java11 Aug 2002 19:24:40 -  1.1
  +++ GenericController.java13 Dec 2002 21:37:28 -  1.2
  @@ -99,6 +99,15 @@
public GenericController()
{
}
  + 
  + public boolean isNextFirst()
  + {
  + if(current == 0)
  + {
  + return true;
  + }
  + return false;
  + }
   
/
 * Gets the ConfigElements attribute of the GenericController object
  
  
  
  1.2   +6 -1  
jakarta-jmeter/src/core/org/apache/jmeter/control/Controller.java
  
  Index: Controller.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/control/Controller.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Controller.java   11 Aug 2002 19:24:42 -  1.1
  +++ Controller.java   13 Dec 2002 21:37:28 -  1.2
  @@ -92,4 +92,9 @@
 * of the test.
 */
public boolean isDone();
  + 
  + /**
  +  * By using this method, one can ask the controller if the next Sampler is the
  +  * first in the Controller's list.
  * @return boolean
  */
  + public boolean isNextFirst();
   }
  
  
  
  1.12  +6 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JMeterThread.java 17 Oct 2002 19:47:17 -  1.11
  +++ JMeterThread.java 13 Dec 2002 21:37:28 -  1.12
  @@ -129,10 +129,13 @@
rampUpDelay();
log.info("Thread "+Thread.currentThread().getName()+" 
started");
while (running) {
  - notifyThreadListeners();
while (controller.hasNext() && running) {
try
{
  + if(controller.isNextFirst())
  + {
  + notifyThreadListeners();
  + }
SamplePackage pack = 
compiler.configureSampler(controller.next());
delay(pack.getTimers());
SampleResult result = 
pack.getSampler().sample(null);
  
  
  
  1.4   +8 -3  
jakarta-jmeter/src/core/org/apache/jmeter/threads/ThreadGroup.java
  
  Index: ThreadGroup.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/threads/ThreadGroup.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThreadGroup.java  29 Aug 2002 18:17:40 -  1.3
  +++ ThreadGroup.java  13 Dec 2002 21:37:28 -  1.4
  @@ -145,6 +145,11 @@
{
setProperty(RAMP_TIME,new Integer(rampUp));
}
  + 
  + public boolean isNextFirst()
  + {
  + return getSamplerController().isNextFirst();
  + }
   
/
 * !ToDoo (Method description)
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/threads JMeterThread.java

2002-08-25 Thread mstover1

mstover12002/08/25 13:10:04

  Modified:src/core/org/apache/jmeter/engine StandardJMeterEngine.java
   src/core/org/apache/jmeter/threads JMeterThread.java
  Log:
  Can stop test quickly despite ramp-up delay or long timers
  
  Revision  ChangesPath
  1.8   +9 -7  
jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
  
  Index: StandardJMeterEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StandardJMeterEngine.java 25 Aug 2002 19:42:20 -  1.7
  +++ StandardJMeterEngine.java 25 Aug 2002 20:10:04 -  1.8
  @@ -56,11 +56,12 @@
   
   import java.io.PrintWriter;
   import java.io.StringWriter;
  +import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.LinkedList;
   import java.util.List;
  -import java.util.Set;
  +import java.util.Map;
   
   import org.apache.jmeter.reporters.ResultCollector;
   import org.apache.jmeter.testelement.TestElement;
  @@ -87,7 +88,7 @@
   {
private static Logger log = Hierarchy.getDefaultHierarchy().getLoggerFor(
"jmeter.engine");
  - Set allThreads;
  + Map allThreads;
boolean running = false;
ListedHashTree test;
SearchByClass testListeners;
  @@ -99,7 +100,7 @@
 ***/
public StandardJMeterEngine()
{
  - allThreads = new HashSet();
  + allThreads = new HashMap();
}
   
public StandardJMeterEngine(String host)
  @@ -172,7 +173,7 @@

threads[i].setThreadName(group.getName()+"-"+(i+1));
Thread newThread = new Thread(threads[i]);
newThread.setName(group.getName()+"-"+(i+1));
  - allThreads.add(threads[i]);
  + allThreads.put(threads[i],newThread);
newThread.start();
}
}
  @@ -291,11 +292,12 @@
public void stopTest()
{
running = false;
  - Iterator iter = new HashSet(allThreads).iterator();
  + Iterator iter = new HashSet(allThreads.keySet()).iterator();
while(iter.hasNext())
{
JMeterThread item = (JMeterThread)iter.next();
item.stop();
  + ((Thread)allThreads.get(item)).interrupt();
}
}
   
  
  
  
  1.5   +4 -4  
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JMeterThread.java 24 Aug 2002 04:27:44 -  1.4
  +++ JMeterThread.java 25 Aug 2002 20:10:04 -  1.5
  @@ -161,7 +161,8 @@
 * !ToDo (Method description)
 ***/
public void stop() {
  - running = false;
  + running = false;
  + log.info("stopping "+threadName);
}
private void checkAssertions(List assertions, SampleResult result) {
Iterator iter = assertions.iterator();
  @@ -225,7 +226,6 @@
Thread.sleep(initialDelay);
}
catch (InterruptedException e) {
  - log.error("",e);
}
}
}
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: