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

Locust does not count RPS if all requests fails #715

Closed
frenetic opened this issue Dec 21, 2017 · 3 comments
Closed

Locust does not count RPS if all requests fails #715

frenetic opened this issue Dec 21, 2017 · 3 comments

Comments

@frenetic
Copy link

Description of issue / feature request

Im testing an endpoint, which is expected to returns HTTPS 403 (99.9% of the scenarios I have in my file).
Im doing this to test how this endpoint deals with its DB, Redis and 3rd party auths.

Expected behavior

I was expecting to see the correct number of requests per second

Actual behavior

Locust says it is doing 0 requests per second.
image

Actually, if we see through the next chart - even though Locust is displaying the correct AVG response time, it only display the RPS for successful requests.

image

Environment settings (for bug reports)

  • OS: Ubuntu 16.04 x64
  • Python version: Python 2.7.12
  • Locust version: 0.8.1

Steps to reproduce (for bug reports)

I cant share my locust.py, since it holds sensitive data.
However, just write a test for an endpoint that always returns 403 - no matter what.

@myzhan
Copy link
Contributor

myzhan commented Dec 26, 2017

It's a feature, you can call events.request_success.fire() directly to work around.

See https://docs.locust.io/en/latest/testing-other-systems.html

pseudo code

response = requests.get(endpoint)
if not response.ok:
    events.request_success.fire(request_type="http", name="fail", response_time=100, response_length=10)
else:
    events.request_success.fire(request_type="http", name="success", response_time=100, response_length=10)

@frenetic
Copy link
Author

I think I might be stupid.
Thank you for your help.

@heyman
Copy link
Member

heyman commented Dec 28, 2017

@frenetic No worries :). We've chosen to only include requests that's considered "successes" in the RPS, but I think one could definitely make a case for including all requests that resulted in a response from the web server.

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

No branches or pull requests

3 participants