Coder Social home page Coder Social logo

artillery-engine-socketio-v3's People

Contributors

grufft avatar jlnquere avatar ptejada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

artillery-engine-socketio-v3's Issues

acknowledge failed

          acknowledge:
          capture:
            json: "$.protocol"
            as: "ack"
      - log: "Acknowledgement == {{ack}}"

Form the code I When i emit message with ' channel : "command" and event: "command"'. I got message "Acknowledgement == {"value":"","failed":true}" but i check socket.io server emit was success. How to Fix it this is example acknowledge result with json type

      {
    "protocol": {
        "version": "1",
        "command": "ack",
        "invoke": "1",
        "qos": "normal",
    }
}

Add support for Artillery 2.0

Artillery v1.x is deprecated and no longer maintained.

Image

The goal here is to assess whether it is worth upgrading this plugin to be compatible with Artillery 2.0.

Query parameters ignored

Here's how i'm using the config, i enabled debug logs and i don't see query parameters being passed in the request.

config:
target: "MY_URL"
phases:
- duration: 60
arrivalRate: 5
engines:
socketio-v3:
transports: ["websocket"]
query:
Authorization: "MY_TOKEN"

how to install

i want to load test my socket.io ver 3 application, is there any brief way actually to install and use this package .

How to pass extraHeaders to scenario

Hi @ptejada ,

I'm trying to pass extra headers by using:

scenarios:
  - engine: socketio-v3
    socketio:
      extraHeaders:
        Cookie: "test=123456"
....

But this is not working, console.log from server-side always returns undefined

Do you have any idea on this?

Thank you

How to use beforeRequest to override query

Is it possible to override query in beforeRequest ?
I want to provide a dynamic value in query, that changes between each request but I couldn't find a way to do it.
Any idea how to do it ?

The secret-token cannot be dynamic

config:
  payload:
    path: "credentials.csv"
    fields:
      - "secretToken"
  engines:
    socketio-v3:
      parser: msgpack
      query:
        token: {{ secretToken }}

This plugin does not support getting a secretToken from context.vars or from a credentials.csv file. It only supports a single hard-coded token for one user. If an app follows best practices and requires a token up front in order to establish the connection, then this plugin only supports a single user. You can have many different instances of that user, but they all must be the same user. For apps where this is considered a security violation, (one connection per user) then this design flaw is a showstopper. Anybody know a way around this limitation?

I tried using the reconnect:true option, but it still has to reconnect using the hard-coded secretToken instead of a dynamic value as implied in the (non-functional) code above.

Unable to emit data to Java netty-socketio

I'm doing simple load test on netty-socketio Java, here when I run the load test I get "Client connected" message but looks like flows are not getting executed (I don't see any message in console after Client Connected) and all requests are getting timed out

Output

errors.Error: timeout: ......................................................... 425
vusers.created: ................................................................ 425
vusers.created_by_name.My sample scenario: ..................................... 425
vusers.failed: ................................................................. 425

loadtest.yml

config:
  target: "ws://localhost:9093"
  ws:
    maxRedirects: 25
  phases:
    - duration: 20
      arrivalRate: 5
      rampTo: 10
      name: "Warming up"
    - duration: 5
      arrivalRate: 10
      rampTo: 100
      name: "Max load"
  engines:
    socketio-v3: { }

scenarios:
  - name: My sample scenario
    engine: socketio-v3
    flow:
      - emit: ["data"]

Java

@Component
public class ServerCommandLineRunner implements CommandLineRunner {

  private final SocketIOServer server;

  @Autowired
  public ServerCommandLineRunner(SocketIOServer server) {
    this.server = server;

    server.addConnectListener(new ConnectListener() {
      public void onConnect(SocketIOClient client) {
        System.out.println("Client connected: " + client.getSessionId());
      }
    });

    server.addDisconnectListener(new DisconnectListener() {
      public void onDisconnect(SocketIOClient client) {
        System.out.println("Client disconnected: " + client.getSessionId());
      }
    });

    server.addEventListener("chat", String.class, (client, data, ackRequest) -> {
      System.out.println("Message received: " + data);
      server.getBroadcastOperations().sendEvent("chat", data);
    });
  }

  @Override
  public void run(String... args) throws Exception {
    server.start();
  }
}

Change Response timeout.

I need to change waiting timeout for response after emit message. I found setting in modules. can I change in that config section or any way to set timeout ?. SO i try to change in config but still not working or after change i need to apply or running other command ?

image

Run custom hook when an event is received

Hello! I'm trying to connect a virtual user (VU) to my socket.io server that joins a room, waits for a message to be sent from the server to that room, and triggers a custom function on receiving that event.

The server has an external trigger that emits an event (fooEvent), and I want to inject a custom hook for some metric collection.

For example, I'd hope to do something like this:

scenarios:
 - name: new socket.io client listening for event 
       flow:
        - emit: ["join", "room1"]
           response:
             on: fooEvent
             function: myCustomFunction

A version of this question has already been asked here, but I believe my use case it subtly different.

All the examples that use response here seem to be dependent on an emit first, and none of them use functions in ./functions.js in the way that I'm trying to use it.

Cannot read property 'forEach' of undefined

Hello, thanks for your work on this package!

I installed artillery following the main docs, and the v3 engine using the readme.

My yaml file:

config:
  target: "http://localhost:3000"
  phases:
    - duration: 30
      arrivalRate: 5
  engines:
   socketio-v3: {}
  scenarios:
    - name: test
      engine: socketio-v3
      flow:
        - emit: ["test"]

When I run the test, I get the following error:

/Users/me/.nvm/versions/node/v16.4.0/lib/node_modules/artillery/lib/commands/run.js:318
  script.scenarios.forEach(function(scenario) {
                   ^

TypeError: Cannot read property 'forEach' of undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.