jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "frank sander" <frank_san...@hotmail.com>
Subject How to write a date controller for jmeter 1.9.1 ?
Date Fri, 14 Nov 2003 16:16:07 GMT
Hello friends,

I'm new in JMeter and struggle with some problems. I want to write a 
controller which executes Samples only at service times (e.g. 7 am to 7 pm). 
I want to have a continous test, so there will be no termination of the test 
at all.

I did following:
I wrote a JMeterTimeController class inherited from GenericController and a 
JMeterTimeControllerGui inherited from AbstractControllerGui.

My understanding is, that the Sample, I want to test, is nested inside this 
Controller.
I implemented the "public Sample next()" method, which returns the Sample at 
service time and returns null, if not (e.g. at 12 am).

Code is following:
    public Sampler next() {
		Date date = new Date(System.currentTimeMillis());
		Sampler currentElement = super.next();
		if (date.getHours()>6 || date.getHours()<20 ) {
			return currentElement;
		} else {
			return null;
		}
    }

setDone(true) isn't called, because I don't want the Test stopped.
I saw similar code in IfController.java and I wonder, why I get allways a 
"StackOverflow" Exception.

The tree in the Gui is following:

TestPlan
+-Thread
   +-Time Controller (the one I wrote)
      +-Sample
      +-Config
      +-Constant Throughput Timer

What did I miss ?

Thank you for your help and suggestions,

Greetings,

Frank

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message