SetThinkTimeFactor Function

Action

Think time factors can be defined to manipulate think times on a global basis. When enabled, factors are multiplied to all think times that are included in scripts. Think time manipulation can be enabled/disabled and manipulation factors are adjusted using the SetThinkTimeFactor function. When random think time is enabled, manipulation factors are applied after randomization.

注: Adjusting think time factors is not available if running a stress test or performing a Try Script run, because Silk Performer ignores think times with those workload settings. Note that Silk Performer will report an error when executing a stress test or Try Script run with adjusted think time factors.

An error also occurrs if think times are adjusted manually to stress test or none, which Silk Performer sets implicitly for a given workload:

SetThinktimeAdjustment(OPT_TTA_NONE); // or

SetThinktimeAdjustment(OPT_TTA_STRESSTEST);

To avoid error messages in verification test runs, you may manually set think time adjustments in a script:

SetThinktimeAdjustment(OPT_TTA_STATIC, 1.0); // or

SetThinktimeAdjustment(OPT_TTA_DYNAMIC, 3.0, 9.0);

Include file

kernel.bdh

Syntax

SetThinkTimeFactor( in bEnable          : boolean,
                    in fThinkTimeFactor : float optional );
Parameter Description
bEnable Specifies whether think time manipulation using a think time factor should be activated.
fThinkTimefactor The think-time factor that is applied when think time manipulation is enabled. This parameter may be omitted, in which case the currently adjusted factor will be reapplied.

Example

dcltrans
  transaction TmyTrans1
  var
    fTTF : float;
  begin
    SetThinkTimeFactor(true, 1.2);
    ThinkTime(1.0);
    SetThinkTimeFactor(false, 1.2);
    ThinkTime(1.0);
    SetThinkTimeFactor(true);
    ThinkTime(1.0);

    if GetThinkTimeFactor(fTTF) then
      Print("Think Time Factor: " + string(fTTF));
    end;
    ThinkTime(1.0);
  end TmyTrans1;

Output

Think Time Factor: 1.2