Skip to content

WebInterface stop updating RPS if Users are doing nothing  #2970

Closed
@andreabisello

Description

@andreabisello

Prerequisites

Description

let's suppose we are spawning 5 HttpUser and every HttpUser makes a self.client.get calls.
The webinterface update itself.
but let's suppose the task has a counter, and after the counter is passed, no self.client.get calls are done.
le't suppose every user will has a counter set to 3, and if >3, do nothing.
increasing the counter +1 at every execution,
we expect 5*4=20 calls.

as you see, 20 calls are done, the test still running
image
but taking a look at the ux, it looks like it's still doing 2.33 rps,
that's not real,
because no one is doing nothing
the ux should show 0
image

Command line

locust -f .\github_webux.py

Locustfile contents

from locust import HttpUser
import time

class WebuxUser(HttpUser):

    host = ""

    def on_start(self) -> None:

        self.counter = 0

    @task
    def to_something(self):
        if self.counter > 3:
            return
        self.client.get("https://docs.locust.io/")
        self.counter += 1
        time.sleep(1)

Python version

3.11

Locust version

2.32.0

Operating system

windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstaleIssue had no activity. Might still be worth fixing, but dont expect someone else to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions