Truncate number of errors displayed in the web UI #532

Merged
merged 1 commit into from Feb 12, 2017

Projects

None yet

2 participants

@justiniso
Member

This change limits the number of rows on the web UI to display at most 500 rows in the stats and failures tabs. A common scenario is the app failing under load, resulting in a large number of unique failures, bringing the rendering to a halt.

A simple locustfile demonstrates the issue:

import random 

from locust import HttpLocust, TaskSet, task

class UserTasks(TaskSet):

    @task
    def error(self):
        self.client.get("/404/{}".format(random.randint(0,99999999999))

class WebsiteUser(HttpLocust):
    min_wait = 0
    max_wait = 0
    task_set = UserTasks

This will generate a large number of results and errors, eventually killing the page. I feel that 500 results is a reasonable number to display as it's more than anyone could consume manually through the web UI. But for automated processes, the actual results will remain intact.

@justiniso justiniso truncate the number of results and errors displayed on the web ui to …
…avoid slow rendering
c5fcf46
@justiniso justiniso added the bug label Feb 12, 2017
@cgoldberg

LGTM 👍

@justiniso justiniso merged commit fee2868 into master Feb 12, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@justiniso justiniso deleted the fix-slow-ui-on-high-failures branch Feb 12, 2017
@justiniso justiniso added this to the 0.8.0 milestone Feb 12, 2017
This was referenced Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment