I have installed locustio but can't configured it. It is giving errors. I don't know the ports where i can log in. its giving me this error:
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr:
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr: File "/home/neso/.virtualenvs/django2/lib/python3.6/site-packages/psutil/__init__.py", line 386, in _init
raise NoSuchProcess(pid, None, msg)
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr:
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr: psutil.NoSuchProcess: psutil.NoSuchProcess no
process found with pid 6475
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr:
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr: 2020-03-15T08:29:22Z
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr:
[2020-03-15 08:29:22,509] blue-liveconsole4/ERROR/stderr: <Greenlet at 0x7f41eaff9148: <bound method
LocustRunner.monitor_cpu of <locust.runners.LocalLocustRunner object at 0x7f41eaff2dd8>>> failed with
NoSuchProcess
i don"t know where to put the locust.py file. my main project is in the mysites blog subdirectory. So i put it there. and run the command$ locust -f blog/locustfile.py
my locustfile.py:
from locust import HttpLocust, TaskSet, task, between
class UserBehaviour(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.login()
def on_stop(self):
""" on_stop is called when the TaskSet is stopping """
self.logout()
def login(self):
self.client.post("/login", {"username":"boy", "password":"testing321"})
def logout(self):
self.client.post("/logout", {"username":"sourda", "password":"testing321"})
@task(1)
def index(self):
self.client.get("/")
class WebsiteUser(HttpLocust):
host = "http://127.0.0.1:8089"
task_set = UserBehaviour
wait_time = between(5.0, 9.0)