Customize M-eux scripts

Create manual timers

To create manual timers, you need first to create the Data Exchange API Client as described below.

The NeoLoad Data Exchange API Client provides the utility TimerBuilder in order to time a transaction (a set of business actions).

Below is an example of Java code to add a timer.

import com.neotys.rest.dataexchange.model.TimerBuilder;

// Start timer
final TimerBuilder timer = TimerBuilder.start("scriptName", "timerName");
// Do some transactions
vpba16.avw_backboneCellarAndro.avw_.mo_cHATEAU_LE_DOYENNE.click();
// Stop timer
dataExchangeAPIClient.addEntry(timer.stop());


It is possible to enhance the timer’s information with specific data, for example a URL, a status, etc. as shown below:


import com.neotys.rest.dataexchange.model.Status.State;
import com.neotys.rest.dataexchange.model.TimerBuilder;
import com.neotys.rest.dataexchange.model.Status;
import com.neotys.rest.dataexchange.model.Status.State;
import com.neotys.rest.dataexchange.model.StatusBuilder;

// Start timer
final TimerBuilder timer = TimerBuilder.start("scriptName", "timerName");
// Do some transactions
vpba16.avw_backboneCellarAndro.avw_.mo_cHATEAU_LE_DOYENNE.click();
// Specify URL
timer.url("myURL");
// Specify Status
final Status status = (new StatusBuilder()).code("code").message("message").state(State.PASS).build();
timer.status(status);
// Stop timer
dataExchangeAPIClient.addEntry(timer.stop());

The transactions’ timers are then accessible in the Runtime and Results views of NeoLoad:

Timers-Results