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

RPS will become to 0 in distributed mode #971

Closed
wcycxp opened this issue Mar 3, 2019 · 3 comments
Closed

RPS will become to 0 in distributed mode #971

wcycxp opened this issue Mar 3, 2019 · 3 comments

Comments

@wcycxp
Copy link

wcycxp commented Mar 3, 2019

Description of issue / feature request

In my code,i set the stop_timeout =10。When I run it in distributed mode, the vitrual user will become to 0 after 10 seconds. But the rps also become to 0.

Environment settings (for bug reports)

  • OS:
  • Python version: 3.7.1
  • Locust version: 0.9.0

code is below:

from locust import HttpLocust,TaskSet,task,runners,main,stats,events
import time,os,json
class UserBehavior(TaskSet):
    @task(1)
    def job11(self):
        start_time = time.time()
        head = {'token':'165c8b3a345540669765ce7c913a7558'}
        with self.client.get("/mock/14962/account/userLogin",catch_response=True) as response:
            #response_time = int((time.time() - start_time) * 1000)
            #if response_time>3000:
             #   response.failure(response_time)
            if response.status_code==200:
                try:
                    res=response.json()
                    result=res['result']
                    if result==False or 'data' not in res.keys():
                        response.failure(res)
                except:
                    response.failure("no data")

class WebUser(HttpLocust):
    task_set = UserBehavior
    start_time = time.time()
    host = "http://yapi.demo.qunar.com"
    min_wait = 0
    max_wait = 0
    stop_timeout = 10
@myzhan
Copy link
Contributor

myzhan commented Jun 17, 2019

I think the slave doesn't stop reporting empty stats to the master while it's stopped.

https://github.com/locustio/locust/blob/master/locust/runners.py#L449

@cyberw
Copy link
Collaborator

cyberw commented Sep 5, 2019

Maybe this is solved by #1025 ?

@mbeacom
Copy link
Member

mbeacom commented Sep 26, 2019

@wcycxp Please install from master and see if that resolves your issue. #1025 has been merged.

@mbeacom mbeacom closed this as completed Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants