0

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)
  • 1
    The specific error you are getting looks like easy to solve by enabling new PythonAnywhere virtualization on your account (that lets your code access /proc), but you won't be able to run locust with web UI on PythonAnywhere, as you can't run a web app from the console. Looks like you need to run locust on your local machine. – Filip Mar 15 '20 at 14:03
  • How can i enable the virtual machine..i can work with the bashconsole result dont need an web ui but what i need is how to test it – Cavin blake Mar 16 '20 at 05:16
  • To enable the new virtualisation system, send a request to PythonAnywhere support. – Glenn Mar 16 '20 at 10:45

0 Answers0