https://bz.apache.org/bugzilla/show_bug.cgi?id=58299
Bug ID: 58299
Summary: Add interrupt Timer
Product: JMeter
Version: 2.13
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Main
Assignee: [email protected]
Reporter: [email protected]
Samplers such as HTTP can take a long time to return all the date.
There are timeout settings, but these apply to each network message, not the
overall sample.
Once the sampler has completed, the duration assertion can be used to flag
overlong samples, but this could take a very long time.
Rather than update every sampler and its GUI to support an extra timeout
option, it is possible to use the Interruptible.interrupt() method in a Timer.
Timers run before the sampler to which they apply, so they can schedule a
future task to invoke the interrupt() method on the sampler.
The following is a very basic BeanShell Timer implementation:
==== cut here =====
import java.util.concurrent.Executors;
sampler=ctx.getCurrentSampler();
run=new Runnable() {
public void run() {
sampler.interrupt();
}
};
tpool = Executors.newScheduledThreadPool(1);
// schedule the interrupt to occur in 5 seconds from now
tpool.schedule(run, 5L, java.util.concurrent.TimeUnit.SECONDS);
return 0; // don't actually wait
===== cut here =====
It would be useful to have a built-in Timer to perform the same function.
--
You are receiving this mail because:
You are the assignee for the bug.