Silk Performer allows you to adjust think times for each user type. With think time adjustment, a user type’s session time can easily be adjusted to the throughput requirements of the test you are planning.
With this function it is possible to change and disable think time adjustment during a test.
Kernel.bdh
SetThinkTimeAdjustment( in eOption : number , in fThinkTimeFactor : float optional, in fSessionTime : float optional );
Parameter | Description |
---|---|
eOption |
Can be either:
|
fThinkTimeFactor | Think times are multiplied by this static factor to adjust session time. |
fSessionTime | The session time to reach when using dynamic think-time adjustment. |
use "kernel.bdh" var nTrans : number init 0; dcluser user WebUser transactions TWeb : 1; dcltrans transaction TWeb var nTTA : number; begin nTrans := nTrans + 1; ThinkTime(3.0); if nTrans = 5 then SetThinktimeAdjustment(OPT_TTA_DYNAMIC, 3.0, 9.0); end; if nTrans = 9 then SetThinktimeAdjustment(OPT_TTA_NONE); end; nTTA := GetThinkTimeAdjustment(); write("thinktime adjustment: "); if nTTA = OPT_TTA_NONE then write("disabled"); elseif nTTA = OPT_TTA_STRESSTEST then write("stresstest"); elseif nTTA = OPT_TTA_STATIC then write("static"); elseif nTTA = OPT_TTA_DYNAMIC then write("dynamic"); end; end TWeb;