Example: lr_peek_events

In the following example, lr_peek_events enables the Vuser to pause at the start of each iteration. Pause events that occur during an iteration are effective only at the beginning of the next iteration.

{
    /* This example is meant to be run in iterations. */
    /* check for events */
    lr_output_message("About to check for events. Pauses can be intercepted.");
    lr_peek_events();
    lr_output_message("Finished checking for events/pauses.");
    /* implement your logic here */
    lr_think_time(10);
    lr_output_message("Running test steps...");
    return 0;
}

The Replay Log below shows the use of iterations.

Running Vuser...

Starting iteration 1.

Starting action Action.

Action.c(7): About to check for events. Pauses can be intercepted now.

Action.c(9): Finished checking for events/pauses.

Action.c(13): Running test steps...

Ending action Action.

Ending iteration 1.

Starting iteration 2.

Starting action Action.

Action.c(7): About to check for events. Pauses can be intercepted now.

Action.c(9): Finished checking for events/pauses.

Action.c(13): Running test steps...

Ending action Action.

Ending iteration 2.

Ending Vuser...

Starting action vuser_end.

Ending action vuser_end.

Vuser Terminated.