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

Report charts plot data points after the test has ended #1677

Closed
TheBronx opened this issue Jan 19, 2021 · 1 comment · Fixed by #1678
Closed

Report charts plot data points after the test has ended #1677

TheBronx opened this issue Jan 19, 2021 · 1 comment · Fixed by #1678
Labels

Comments

@TheBronx
Copy link

TheBronx commented Jan 19, 2021

imagen
imagen

Describe the bug

After stopping a test on the UI, when I click on "Download report" the plots show a date range between test-start and now, instead of test-start and test-end.

Expected behavior

All the plots should only contain data between test-start and test-end dates I guess.

Actual behavior

All three plots in the report continue plotting either 0 (Response Times and Number of Users) or RPS (Total Requests per Second) after the test has ended up until the moment you open or refresh the Download Report page.

Steps to reproduce

  • Start the UI with any test file (the Quick Start one for example: https://docs.locust.io/en/stable/quickstart.html): locust -f example.py
  • Parameters don't matter as far as I know, just run the test
  • Let it run for a few seconds
  • Stop it
  • Wait for 10 or 20 seconds so it is easier to see the bug
  • Click on Download Data -> Download Report
  • Notice the flatlines on the plots and the date ranges, extending way after the test was stopped. If you refresh this page (the report) the plots just keep growing.
  • Interestingly enough, the start and end dates at the top of the report are correct

Environment

  • OS: Ubuntu 20.04
  • Browser: Firefox 84.0.2 and Chromium 87.0.4280.141
  • Python version: 3.8.5
  • Locust version: 1.4.1
  • Locust command line that you ran: locust -f example.py
  • Locust file contents (anonymized if necessary):
import time
from locust import HttpUser, task

class QuickstartUser(HttpUser):
    @task
    def hello_world(self):
        self.client.get("/hello")
        self.client.get("/world")

    @task(3)
    def view_item(self):
        for item_id in range(10):
            self.client.get(f"/item?id={item_id}", name="/item")
            time.sleep(1)

    def on_start(self):
        self.client.post("/login", json={"username":"foo", "password":"bar"})

BTW I think this is a great tool, I have just discovered it and I am loving it! ❤️

@TheBronx TheBronx added the bug label Jan 19, 2021
@TheBronx TheBronx changed the title Generated report does not take into account when the test has finished Report charts plot data points after the test has ended Jan 19, 2021
@aek
Copy link
Contributor

aek commented Jan 19, 2021

I'm agree with you. 👍
Let me review the code, maybe I could make a PR to solve this. Also I don't like that charts data disappear after a page refresh but it properly show up when you generate the test report

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

Successfully merging a pull request may close this issue.

2 participants