jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Design of Timeout test element / sampler interrupter
Date Sun, 30 Aug 2015 00:06:53 GMT
I've had a look at the classes that implement SampleListener, and
apart from ResultAction and TransactionSampler, only the Listeners use
it. Since usage of these should be minimised in a production test,
it's likely that there won't be as many implementations as I had
feard.

Also if the implementation is empty, the overhead will be quite small.

[There is a work-round if it does prove expensive: the SampleListener
interface could be split into two parent interfaces.]

So assuming that JMeterThread implements sampleStarted/sampleStopped,
the Timeout element can use the Start to set up the timer and the Stop
to cancel it. This will reduce the number outstanding as much as
possible.

The timeouts have to be implemented using separate threads for two reasons:
- it's obviously not possible to interrupt a sampler from the same
thread as the sampler
- depending on the sampler, and its state, the interrupt may take a
while to complete, so each interrupt must be done in its own thread

It should be possible to use a single shared instance of the
ScheduledExecutorService; that could be lazily created using IODH. [I
can try that with the current implementation]

As to whether the Timeout class should be a Timer or some other type
of test element - that does not matter so long as it can be applied to
the samplers individually or when in scope.

I chose Timer because it was already called in the right place, but I
assume JMeterThread can call any Test class provided that it
implemented the SampleInterface.

It must be one of the existing Test Element classes that are handled
by the Menu system otherwise it will need special handling.

The scope requirement rules out Config elements and Logic Controllers.
It does not seem like a pre-processor to me, nor a post-procesor, nor a Listener

So AFAICT the only remaining options are the Timer and Assertions.

I think both are justifiable.

The name of the class can of course be changed from InterruptTimer - I
think that is probably not the best choice. Maybe something like
SamplerTimeout?

Mime
View raw message