SetThinkTimeAdjustment Function

Action

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.

Include file

Kernel.bdh

Syntax

SetThinkTimeAdjustment( in eOption          : number ,
                        in fThinkTimeFactor : float optional,
                        in fSessionTime     : float optional );
Parameter Description
eOption

Can be either:

  • OPT_TTA_NONE : Disables think time adjustment.

  • OPT_TTA_STRESSTEST : Think times are ignored.

  • OPT_TTA_STATIC : Think times are multiplied by a static factor to adjust session time. The parameter fThinkTimeFactor must be specified.

  • OPT_TTA_DYNAMIC : Dynamic think time adaptation is used to keep throughput rates constant at varying load levels. Both the fThinktimeFactor and fSessionTime parameters must be specified.

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.

Example

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;