Load test gRPC application with Artillery.io
For users:
For developers:
# if `artillery` is installed globally
npm install -g artillery-engine-grpc
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;
}
config:
target: 127.0.0.1:8080
phases:
- duration: 10
arrivalRate: 10
pause: 15
engines:
grpc:
channelOpts:
grpc.client_idle_timeout_ms: 1000
protobufDefinition:
filepath: protobuf-definitions/backend/services/v1/hello.proto
package: backend.services.v1
service: HelloService
protoLoaderConfig:
keepCase: true
longs: String
enums: String
bytes: Buffer
defaults: false
arrays: false
objects: false
oneofs: true
includeDirs: []
metadata:
"user-id": u123
scenarios:
- name: test backend-service running at http://localhost:8000
engine: grpc
flow:
# list RPC names with its arguments
- Hello:
id: 1
name: Alice
- Hello:
id: 2
name: Bob
- Hello:
id: 3
name: Chris
artillery run my-scenario.yml