This is a general purpose gRPC load test. It supports compute, reading/writing data, initialization, and produces JSON formatted stats.
This can be compiled using go generate
and go build
. The following packages
are required for building: protoc-gen-go
, protoc-gen-go-grpc
, and
golang-google-protobuf-dev
. There is a provided Dockerfile.
go generate
go build
Generate 1000 example tasks:
./loadtest gentasks --count 1000 tasks.jsonl
Directly run loadtest with the test data:
./loadtest load tasks.jsonl
You will see both logging (on stderr) and the generated output (on stdout).
Run the pricing engine locally on the default port 2002:
./loadtest serve
In a separate command prompt, grpcurl with the test data to try it out: to generate JSON test data for the pricing library. This will only send in the first request.
head -n 1 tasks.jsonl | grpcurl -d @ -plaintext localhost:2002 main.PricingService/CalcPrices
NOTE: You can use the --logJSON to produce JSON formatted logs which includes some performance statistics. These can be directly queried with distributed jobs using Google Cloud Logging with Log Analytics.
docker build -t loadtest .
Generate 1000 example tasks:
docker run loadtest gentasks --count 1000 - > tasks.jsonl
Directly run loadtest with the test data:
docker run -v $PWD:/data loadtest load /data/tasks.jsonl
Run the loadtest engine locally on the default port 2002:
docker run -p 2002:2002 loadtest serve
In a separate command prompt, grpcurl with the test data to try it out: to generate JSON test data for the pricing library. This will only send in the first request.
head -n 1 tasks.jsonl | grpcurl -d @ -plaintext localhost:2002 main.LoadTestService/RunLibrary