Skip to content

HTML report uses current_rps instead of total_rps for req/s column #3355

@abhi2196

Description

@abhi2196

Prerequisites

Description

Description

The HTML report generated via --html uses current_rps (a ~10-second
sliding window average) for the req/s column instead of total_rps
(total requests / total test duration). This makes the HTML report
inconsistent with the final console summary, which correctly uses
total_rps since the fix in #1152.

Since the HTML report is a post-test artifact representing the
entire test run, it should use total_rps — not a stale snapshot
of whatever the last ~10 seconds of the test looked like.

How the inconsistency arises

html.py calls to_dict() without any current flag: Code Link

"requests_statistics": [stat.to_dict() for stat in requests_statistics],

Command line

locust -f locustfile.py --headless -u 5 -r 5 -t 30s --html repro_report.html --only-summary

Locustfile contents

from locust import HttpUser, task, between


class ReproUser(HttpUser):
    wait_time = between(0.1, 0.2)
    host = "https://httpbin.org"

    @task
    def get_ip(self):
        self.client.get("/ip")

Python version

3.12

Locust version

2.32

Operating system

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions