Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

kenju/artillery-plugin-loadbalancer

Repository files navigation

artillery-plugin-loadbalancer

npm version

Load Balance your request to multiple targets for Artillery.io

Usage

Install the plugin

# if `artillery` is installed globally
npm install -g artillery-plugin-loadbalancer

Define your scenario

.proto file

syntax = "proto3";

package backend.services.v1;

service HelloService {
    rpc Hello (HelloRequest) returns (HelloResponse) {
    }
}

message HelloRequest {
    int32 id = 1;
    string name = 2;
}

message HelloResponse {
    string message = 1;
}

scenario file

Add config.plugins.loadbalancer settings as follows:

# my-scenario.yml
config:
  target: 127.0.0.1:8080
  phases:
    - duration: 10 #sec
      arrivalRate: 1
  plugins:
    loadbalancer:
      strategy: roundrobin
      targets:
        - target: 127.0.0.1:8080
        - target: 127.0.0.1:8081
  engines:
    grpc:
      protobufDefinition:
        filepath: protobuf-definitions/backend/services/v1/hello.proto
        package: backend.services.v1
        service: HelloService
      protoLoaderConfig:
        includeDirs: [ './protobuf-definitions' ]

scenarios:
  - name: test backend-service
    engine: grpc
    flow:
      - Hello:
          id: 1
          name: Alice
      - Hello:
          id: 2
          name: Bob

Run the scenario

artillery run my-scenario.yml

License

MPL-2.0

About

Load Balance artillery's request to multiple targets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published