Skip to content

Latest commit

 

History

History
99 lines (65 loc) · 2.21 KB

File metadata and controls

99 lines (65 loc) · 2.21 KB

Load Test for HTC

Overview

This is a general purpose gRPC load test. It supports compute, reading/writing data, initialization, and produces JSON formatted stats.

Compilation

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.

Running locally

Building

go generate
go build

Generate test data

Generate 1000 example tasks:

./loadtest gentasks --count 1000 tasks.jsonl

With the file directly

Directly run loadtest with the test data:

./loadtest load tasks.jsonl

You will see both logging (on stderr) and the generated output (on stdout).

With gRPC

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.

Running in a container

Build the container

docker build -t loadtest .

Generate test data

Generate 1000 example tasks:

docker run loadtest gentasks --count 1000 - > tasks.jsonl

With the file directly

Directly run loadtest with the test data:

docker run -v $PWD:/data loadtest load /data/tasks.jsonl

With gRPC

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