Unanswered question

I want to capture duration of an request in my script. Can Customer_Measurement help my req? Pls share sample code

When I do a test run for 250 users, I want to capture the duration time for a specific request into a variable and later I can write that variable in to a external file.

Note: I know how to write a variable to external file. I am not sure how to capture the duration. Can Custom_Measurement action help ? if so can anyone share sample code to achieve same. Thanks

Harish K.
Harish K.

Harish K.

Level
0
12 / 100
points

Answers

It's not possible yet to capture the duration of a request (or a Transaction).

Why do you need it so that I can check if a coming feature may help you? What is the goal of having this external file?

Harish K.
Harish K.

Harish K.

Level
0
12 / 100
points

"It's not possible yet to capture the duration of a request (or a Transaction).

Why do you need it so that I can check if a coming feature may help you? What is the goal of having this external file?"

Harish: Thanks for your reply. The reason I need this as we run for more users say 250, I wanted to make sure the request is run for all 250, coz I noticed a pattern where Neoload is not completing the test for all users. Also having this duration and write it to a csv file would help me to find out under which scenario(which virtual user), the request is taking a long time. This would help us to pass on information to our devs.

Also please share an example on how to use Custom_Measurement miscellaneous action.

Thanks for providing more details. Another way to investigate on some longer response time is to set an assertion of kind response time on the request to investigate. Then, when the response is too long, an error is raised and you have the full context (VU, LG, previous request, etc..)

Regarding how many time the request is performed, note that Transactions are interrupted when the test stops if the scenario ends by time (Transaction time not taken in account when interrupted). You can execute by Iteration so that the test executes all the requests of a VU. Also note that if the Error policy is not Continue on error, then a request is not executed if an error failed before. You can analyze on this in the values tab, "Tree view", and look at 'Count' and 'Errors'.

Regarding the Custom_Measurement, the goal is to bring visibility to a measurement obtained through an alternate way (Javascript, Custom Action, extracted from an API call, etc...). Simply put your measurement is a variable and use '${myMeasurement}' as the value of the Custom_Measurement so that it can be analyzed in Values tab, graphed and be part of a Transaction.