Closed asfimport closed 21 years ago
Jordi Salvat i Alabart (migrated from Bugzilla): Created attachment ConstantThroughputTimer.java: src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
Jordi Salvat i Alabart (migrated from Bugzilla): Created attachment ConstantThroughputTimerGui.java: src/components/org/apache/jmeter/timers/gui/ConstantThroughputTimerGui.java
Jordi Salvat i Alabart (migrated from Bugzilla): Hi.
I'm attaching the code for a new Timer I've created which allows you to put the server under pre-specified load.
I've found this useful when the performance requirement to test against is in the lines of "the system should be able to serve X pages per minute with latencies lower than Y milliseconds." (Which is probably one of the best ways to express performance requirements).
To use it:
Drop the two attached files in src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java src/components/org/apache/jmeter/timers/gui/ConstantThroughputTimerGui.java
Add the following resources to ./src/core/org/apache/jmeter/resources/messages.properties (and the corresponding translations, of course): constant_throughput_timer_memo=Add a delay between sampling to attain constant throughput constant_throughput_timer_title=Constant Throughput Timer constant_throughput_timer_throughput=Thread Throughput (in samples per minute):
Create your test, adding a Constant Throughput Timer to the Thread Group. (I've not tested the behaviour of this timer when placed at other levels, nor when combined with other timers).
Run your test. Sampling will happen at the specified rate -- or as fast as possible if the system is not fast enough to attain that rate.
Note the rate is for the ensemble of all threads: adding more threads will cause each of them to run slower.
One difficulty I've encountered when writing this is that there's no method to signal a test component when the test is starting. I've assumed that a new timer object is created (or cloned) for every test run. The timer seems to behave as expected, so looks like this assumption is correct...
Salut,
Jordi.
Mike Stover (migrated from Bugzilla): You can implement the TestListener interface to be notified of when the test starts.
Jordi Salvat i Alabart (Bug 11523): I'd like to see a timer which waits for an specified amout of time MINUS whatever the previous sample took.
In this way, it is possible to hit a site with (for example) 2 hits per second -- no matter how fast the site responds (as far as it responds in less of .5 secs, of course). There's currently no way to do this (as far as I know).
Version: Nightly OS: All