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 can not count failure request number in WEB GUI #480

Closed
yisake opened this issue Sep 20, 2016 · 2 comments
Closed

Locust can not count failure request number in WEB GUI #480

yisake opened this issue Sep 20, 2016 · 2 comments

Comments

@yisake
Copy link

yisake commented Sep 20, 2016

Attached my test script and screenshot. Locust didn't count the whole number for failed request and just show every Exception on WEB GUI.

`#encoding=utf-8
from locust import HttpLocust, TaskSet, task , events
import requests
import time

class WebsiteTasks(TaskSet):

@task
def page(self):
    start_time = time.time()
    try:
        requests.get("http://127.0.0.1:8000/index")
    except Exception,e:
        total_time = int((time.time() - start_time) * 1000)
        events.request_failure.fire(request_type="测试GET请求", name="http://127.0.0.1:8000/index", response_time=total_time, exception=e)
    else:
        total_time = int((time.time() - start_time) * 1000)
        events.request_success.fire(request_type="测试GET请求", name="http://127.0.0.1:8000/index", response_time=total_time, response_length=0)

@task
def index(self):
    self.client.get("http://httpbin.org/cookies/set/sessioncookie/123456789")

class WebsiteUser(HttpLocust):

host = ''
task_set = WebsiteTasks
min_wait = 500
max_wait = 500`

Main page

image

Failure page

image

@yisake
Copy link
Author

yisake commented Sep 20, 2016

All of the Exception is the same type of NewConnectionError. ~~

@heyman
Copy link
Member

heyman commented Sep 20, 2016

This was most likely related to #451 and #452, which has now been fixed.

@heyman heyman closed this as completed Sep 20, 2016
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

2 participants