I want to know if it's possible to put custom values on "# Requests" and "#Failures" columns on graphic interface, instead of the automatics 1 or 0.
I'm using Locust in order to calculate the response time of my website. Because I wanted to calculate it for each scenario, and not for each request, I used events.request.fire.
So, for each request, I save the response time and the size in variables, as long as the success ans failures. And, at the end, I use events.request.fire to display the whole scenario in only one line on the locust interface.
events.request.fire(
request_type="Full_scenario",
name=f"Scénario 2, number : {self.count}, id:{self.user_id}",
response_time=full_response_time,
response_length=full_response_length,
exception = errors
)
So, now I'm displaying custom values for the response time and the average size columns and the informations about failures (on the failure page). Also, with my syntax for the name of my scenarios "name=f"Scénario 2, number : {self.count}, id:{self.user_id}"", each line will be a unique scenario
But is it possible to display custom values for # Requests and # Failures columns ? I want to put in theses columns the total number of requests that I have in my scenarios.
No, you can't override the number of requests and failures for an endpoint. You could fabricate the number by firing the number of request events that you want for each, if that's really what you want to do.
However, you may consider using Locust's other options for handling custom data:
There are all sorts of ways you can use these features to customize the data Locust displays. You can track and aggregate custom metrics, have an endpoint on the master you can hit to return the data, and even add your own tabs with tables and/or charts to display the data you want in the way you want (it's often easiest to copy and paste the Locust code and then adjust it to fit your needs, but you can do all sorts of other things).