loadrunner Lr_类函数之 lr_get_transaction_think_time()

lr_get_transaction_think_time()

返回事务的思考时间。

double lr_get_transaction_think_time(const char * transaction);

 

参数说明:

transaction:事务名称。

 

lr_get_transaction_think_time函数返回指定事务的思考时间,直到此时为止。 它仅为打开的事务返回大于零的值。

要确定其他事务统计信息,例如思考时间和浪费的时间,请使用适当的事务函数。

 

示例:lr_get_transaction_think_time

在以下示例中,lr_get_transaction_think_time函数获取思考时间,并将其发送到“输出”窗口。

double think_time;

lr_start_transaction(“Flight”);

web_url(“home; sz = 234x60; tile = 1; ord = 977672495775323400”,

        “URL = http://ad.doubleclick.net/...ord=977672495775323400”,

        ... ..

        “Mode = URL”,

        LAST);

think_time = lr_get_transaction_think_time(“Flight”);

status = web_submit_data(“flight”,

        “Action = http://www.mercury-tours.com/cgi-bin/tours?ITN_RESPONSE +”,

        “Method = POST”,

        “TargetFrame =”,

        ... ...

        LAST);

 

/ *结束事务与操作结果 - 通过或失败* /

if(status == 0)

    lr_end_transaction(“Flight”,LR_PASS);

        else

    lr_end_transaction(“Flight”,LR_FAIL);

if(think_time)

    lr_output_message(“事务认为时间是%f秒”,think_time);

else

lr_output_message(“思考时间无法确定”);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章