diff --git a/locust/stats.py b/locust/stats.py index efa6a99840..7af358b3ed 100644 --- a/locust/stats.py +++ b/locust/stats.py @@ -429,14 +429,14 @@ def median_from_dict(total, count): """ def on_request_success(request_type, name, response_time, response_length): + global_stats.get(name, request_type).log(response_time, response_length) if global_stats.max_requests is not None and (global_stats.num_requests + global_stats.num_failures) >= global_stats.max_requests: raise StopLocust("Maximum number of requests reached") - global_stats.get(name, request_type).log(response_time, response_length) def on_request_failure(request_type, name, response_time, exception): + global_stats.get(name, request_type).log_error(exception) if global_stats.max_requests is not None and (global_stats.num_requests + global_stats.num_failures) >= global_stats.max_requests: raise StopLocust("Maximum number of requests reached") - global_stats.get(name, request_type).log_error(exception) def on_report_to_master(client_id, data): data["stats"] = [global_stats.entries[key].get_stripped_report() for key in six.iterkeys(global_stats.entries) if not (global_stats.entries[key].num_requests == 0 and global_stats.entries[key].num_failures == 0)]