GetWorkloadModel Function

Action

Retrieves the type of the active workload which the current virtual user executes.

Include file

Kernel.bdh

Syntax

GetWorkloadModel( out sWorkloadType :string optional,
                  in  nCopy         : number ptional ): number;

Return value

The workload model type as a numeric constant value. Possible return values are:

  • WORKLOAD_STEADYSTATE

  • WORKLOAD_INCREASING

  • WORKLOAD_DYNAMIC

  • WORKLOAD_QUEUING

  • WORKLOAD_MONITORING

  • WORKLOAD_ALLDAY

  • WORKLOAD_VERIFICATION

  • WORKLOAD_SINGLEUSER

Parameter Description
sWorkloadType Buffer to receive the workload type string.
nCopy Number of characters to copy to the buffer (optional, default is STRING_COMPLETE).
注: If GetWorkloadModel returns WORKLOAD_QUEUING, the inout parameter sWorkloadType may not always carry the string "Queuing". The workload models "Try-Script" and "Baseline Test" are as well handled as a queuing workload.

Example

dcluser
  user
    TestUser
  transactions
    TGetWorkload : 1;

dcltrans
  transaction TGetWorkload
  var
    sWorkload: string;
  begin
    if GetWorkloadModel(sWorkload) = WORKLOAD_QUEUING then
      write("active workload type = "); write (sWorkload); writeln;
    else
      write("No queuing workload set.")
    end
  end TGetWorkload;

Output

active workload type = Try Script