Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logged stats show incorrect failure percentage #1074

Closed
zachpmartin opened this issue Aug 27, 2019 · 1 comment
Closed

Logged stats show incorrect failure percentage #1074

zachpmartin opened this issue Aug 27, 2019 · 1 comment

Comments

@zachpmartin
Copy link

zachpmartin commented Aug 27, 2019

Description of issue

The failure percentage stats printed to stdout are calculated incorrectly.
Seen here
fail_percent = (self.num_failures/float(self.num_requests + self.num_failures))*100

Expected behavior

If something fails every request made, the failure percentage should show 100%.
The calculation should be
fail_percent = float(self.num_failures/self.num_requests)*100

Actual behavior

It shows 50% if a request fails every attempt.

Environment settings

  • OS: Fedora 29
  • Python version: 3.6.8
  • Locust version: latest source

Steps to reproduce (for bug reports)

Create a locust file with any failing requests. You can see the number of failures don't match up with the failure percentage.

@zachpmartin
Copy link
Author

Fixed in: 7ce7ca5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant