Comments (9)
Use the example as a starting point https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/socketio_ex.py
you are not supposed to copy the base class :)
from locust-plugins.
Thank you @cyberw , I finally understood the way it works 😅
Ok, I pip installed the plugins.
Since I want to test my websocket, in miniconda/.../locust_plugins/users.py, I changed:
self.ws = websocket.create_connection(f"wss://{ws_host}/socket.io/?EIO=3&transport=websocket")
to
self.ws = websocket.create_connection(f"wss://{ws_host}")
I copied https://github.com/SvenskaSpel/locust-plugins/blob/master/examples/socketio_ex.py to my locustfile.py
and run it
and visited http://0.0.0.0:8089/ to start the load test
... but nothing happen. No user is spawned.
Only warning is about the file size (but it was also present while testing simple GET and it was working):
[2021-03-02 08:54:34,641] pop-os/WARNING/locust.main: System open file limit '1024' is below minimum setting '10000'. It's not high enough for load testing, and the OS didn't allow locust to increase it by itself. See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-number-of-open-files-limit for more info.
[2021-03-02 08:54:34,641] pop-os/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting connections from all network interfaces)
[2021-03-02 08:54:34,648] pop-os/INFO/locust.main: Starting Locust 1.4.3
[2021-03-02 08:54:39,191] pop-os/INFO/locust.runners: Spawning 50 users at the rate 10 users/s (0 users already running)...
my Pop!_OS is Ubuntu 20.04
locust 1.4.3
WSS url to test is sub.REDACTED.com
GET https://sub.REDACTED.com
I guess I missed something :)
Any idea ?
from locust-plugins.
My first thought is that locust is unable to connect to your host. Can you run it in the debugger or print something just before and just after create_connection?
from locust-plugins.
print(ws_host)
self.ws = websocket.create_connection(f"wss://{ws_host}")
print(ws)
results in printing the host once after running and hanging there:
Starting Locust 1.4.3
[2021-03-02 11:18:45,902] pop-os/INFO/locust.runners: Spawning 50 users at the rate 10 users/s (0 users already running)...
REDACTED.com
from locust-plugins.
So websocket
is unable to connect to your host. Most likely, this has nothing to do with locust or SocketIOUser.
Check your network, any proxy settings you might need etc.
from locust-plugins.
I use the same computer and network, actually the REDACTED.com service is running from my LAN, no proxy.
I can see websocket connections from regular clients in real time from my server.
Hmmm, as I want to understand, I re-ran the quickstart example:
import time
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 2.5)
@task
def hello_world(self):
self.client.get("")
from the same install (locust and server).
It totally works:
I really don't understand what is blocking the websocket locust plugin.
from locust-plugins.
Could I send you a private message withe the real domain for you to test?
I added REDACTED since it's a proptype server running from my home and I have to test it today for tomorrow presentation.
from locust-plugins.
FIXED!
I just added the same ws path (already present in the locustfile.py, so I wrongly assumed it was added to the host passed) and now it reaches the server:
I wonder why the path is present is the locustfile :)
Never mind, it's working!
Maybe adding a ping before to make sure the domain is responding might help the error code that should spawn 😄
I'm not into locust enough to know how to do it.
BTW, there are many other questions:
- Looking at the webmin in real-time, I noticed a different behavior than when I use regular clients, how to mimic websocket outgoing?
- How to add websocket and locust-plugins to work with the locust docker container?
from locust-plugins.
I just added the same ws path (already present in the locustfile.py, so I wrongly assumed it was added to the host passed)
Great! I might change it so that it defaults to use the "main" host specified in locust parameters or on host attribute for WS as well (in my use case I also wanted to run http requests against a different domain, so it made sense to keep them separate)
Looking at the webmin in real-time, I noticed a different behavior than when I use regular clients, how to mimic websocket outgoing?
How to add websocket and locust-plugins to work with the locust docker container?
These are things you'll just have to figure out yourself, sorry :)
from locust-plugins.
Related Issues (20)
- Attribute Error: 'Timescale' object has no attribute '_run_id' HOT 1
- psychogreen is not installed when trying to run locust test with timescale
- Issues with running Playwright scripts. HOT 2
- can not start locust and write data to Timescaledb HOT 6
- Can the postgres field testplan be customized? HOT 1
- Add exemple about "extend the web UI to allow you to show custom data along side the built-in Locust stats" HOT 2
- Can the postgres field testplan be customized from a locustfile during run-time? HOT 4
- Browser is not starting in headless mode HOT 1
- AMQP support HOT 3
- 404 in docs HOT 1
- not able to launch browser with playwright example HOT 22
- how to stop locust when Using Locust as a library HOT 18
- SocketIOUser send method supports specific subscribe request #2616 HOT 3
- Does locust support thick-client application? HOT 4
- Add Yandex-Tank visualization HOT 2
- Run Locust with Yandex Tank visualization HOT 4
- playwright plugin does not return data to the locust frontend HOT 12
- [MQTT] locust-plugins is incompatible with paho-mqtt >= 2 HOT 1
- Gret the "Number of user" defined in the web gui HOT 1
- question: add a target environment discriminator column in timescale and edit the grafana charts to allow target environment selection HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from locust-plugins.