locust.events.request_failure takes response_time but does nothing with it.
In fact, the UI shows 0's even if a response time is reported with the request_failure event:

I'm also having this issue. It makes me wonder if the failures that are also in the same line as some successful requests are being treated as if they have 0 response time. This would drastically skew data of the median, average, and min response times. Is there a fix to this?
I know this is old, but I'm also confused why stats.on_request_failure (and the stats system more generally) ignores response_time for failures. It's not obvious at all that this is the case, and even if a request fails I feel like in most cases you would still want to track the response_time in the stats. Or at least have it be configurable.
Yeah, I think we should include the response time of failures as long as we get an HTTP response from the server, but not for other failures such as socket, dns, or connection errors.
To achieve this we should make it so that if response_time is provided by the failure event, it'll be included in the stats. And then in the HTTP client make sure that we only provide response_time to the failure event when we've gotten an actual HTTP response.
@heyman Yeah I think that makes a lot of sense
Hi. Any chance that this will be resolved? I am using following code to (manually) trigger request failures
request_failure.fire(
request_type='WebSocket Recv',
name='app/api/async',
response_time=666,
exception="Something failed",
)
but it still displays 0 instead 666 as response time :(

Can't reproduce in current version.
Maybe this was fixed a long time ago...
Most helpful comment
Yeah, I think we should include the response time of failures as long as we get an HTTP response from the server, but not for other failures such as socket, dns, or connection errors.
To achieve this we should make it so that if response_time is provided by the failure event, it'll be included in the stats. And then in the HTTP client make sure that we only provide response_time to the failure event when we've gotten an actual HTTP response.