Transactions

Any sequence of interactions or page clicks can be grouped as a transaction. Transactions are mechanism to measure server response time for any operation. In simple words, the use of the word “Transaction” helps to measure the time taken by the system for a particular request.

Need of Transaction

Transactions in Script are needed due to the following reasons:

End transaction

In script, Transactions API can be used anywhere in the flow files. End Transaction is normally before ns_page_think_time API.

Alternatively, end the transaction after the URL.

voidflow()
{
// Using transaction for home page
ns_start_transaction("HomePage");
ns_web_url ("Homepage", "URL=http://127.0.0.1/tours/index.html");
ns_end_transaction ("HomePage", NS_AUTO_STATUS);
}
  1. Enter End Transaction Name or select from the available list of started transactions.
  2. In Advanced, you have the following options: