GetUserId Function

Action

Retrieves a unique ID (number) for each current virtual user in a load-test. The ID is 1 for the first virtual user, 2 for the second and n for the nth virtual user.

Include file

Kernel.bdh

Syntax

GetUserId(): number;

Return value

The unique identification number of the user.

Example

dcluser
  user
    TestUser
  transactions
    TGetUserId : 1;
dcltrans
  transaction TGetUserId
  var
    nUserId: number;
  begin
    nUserId := GetUserId();
    write("user ID = "); write(nUserId); writeln;
  end TGetUserId;

Output

user ID = 1