locustio / locust

Write scalable load tests in plain Python 🚗💨
MIT License
24.25k stars 2.93k forks source link

95th percentile line chart does not display correctly on the Response Times (ms) graph #2540

Closed borget closed 6 months ago

borget commented 6 months ago

Prerequisites

Description

The 95th percentile line chart does not correctly display over time,

Every time you do a hard refresh on the Charts screen (http://mylocust.com/?tab=charts) The 95th line starts getting render from the start of the test, and it does not show the historical values.

Example of refreshing the page to see the 95th line behavior

avg_resp_time

The 95th percentile line shows up correctly going directly to the Locust test report

(http://mylocust.com/stats/report?theme=dark)

Screenshot 2024-01-10 at 11 23 50

Command line

-f my_test.py --autostart --modern-ui

Locustfile contents

class FastUser(FastHttpUser):
    tasks = [FastUserTasks]

class FastUserTasks(TaskSet):
    @tag("Task1")
    @task(1)
    def task1(self):
        """
        I omitted how below variables are generated. Overall, there is some logic that generates protobuf messages
        that are sent as binary over http post action when executing the tasks, I have around 22 tasks that send 
        different protobuf messages.
        """
        self.client.post(
            url,
            name=f"/{message_type}",
            data=message,
            headers={
                "Content-Type": "application/octet-stream"
            }
        )

Python version

3.11

Locust version

2.20.1

Operating system

MacOS

cyberw commented 6 months ago

@andrewbaldwin44 Can you take a look?

cyberw commented 6 months ago

@borget Is it working now for you? (use pip install --pre -U locust to get the most recent build)

borget commented 5 months ago

@borget Is it working now for you? (use pip install --pre -U locust to get the most recent build)

Hi @cyberw ! Just wanted to share that the solution is still going strong after a month and I just upgraded to locust== 2.22.0. Huge thanks to everyone for the support