From e9b940d5caeb1d34c589efaad636863a515eaa94 Mon Sep 17 00:00:00 2001 From: Zach Martin Date: Tue, 27 Aug 2019 13:17:43 -0700 Subject: [PATCH] Fix fail percentage The fail percentage was calculated incorrectly. Something that failed all of the time would be reported as failing 50% total. --- locust/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locust/stats.py b/locust/stats.py index 2041e4f62d..736ac4217e 100644 --- a/locust/stats.py +++ b/locust/stats.py @@ -385,7 +385,7 @@ def get_stripped_report(self): def __str__(self): try: - fail_percent = (self.num_failures/float(self.num_requests + self.num_failures))*100 + fail_percent = float(self.num_failures/self.num_requests)*100 except ZeroDivisionError: fail_percent = 0