I wanted to apply Pacing in jmeter for 120- 180 Seconds for all my samplers , I know i can do it with Through put Timers is there anyother way to apply pacing , i think we can use Beanshell Scripting but not sure of how to implement that .
This is the sample Beanshell that i reffered from internet a i tried , i used the random function to get a random pacing beetween 120 to 180 seconds and subracting it with Previous sample time . I think this implementation is wrong . could some of you suggest on this please . Thankyou .
Long pacing =${__Random(120000,180000)} – prev.getTime();
if (pacing > 0) {
Integer iPacing = pacing != null ? pacing.intValue() : null;
log.info(String.valueOf(iPacing));
vars.put(“mydelay”, String.valueOf(iPacing));
return iPacing;
} else {
vars.put(“mydelay”, “0”);
return 0;
}
Source: Read More