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

benchmarking scripts

Emmanuel T Odeke edited this page Feb 23, 2018 · 3 revisions

To run gRPC benchmarks

#!/bin/sh
beginPwd=$PWD
grpcBenchmarksRepo="github.com/rakyll/grpc-go"

# 1. go get "github.com/rakyll/grpc-go"
go get $grpcBenchmarksRepo/...

# 2. cd $(go env GOPATH)/src/$grpcBenchmarksRepo && git checkout "opencensus-benchmarks"
cd $(go env GOPATH)/src/$grpcBenchmarksRepo
originalBranch=$(git rev-parse --abbrev-ref HEAD)
git checkout "opencensus-benchmarks"
benchmarksOutFile=$beginPwd/grpc-opencensus-benchmarks.txt

go run benchmark/benchmain/main.go -benchtime=10s -workloads=all \
    -compression=on -maxConcurrentCalls=1 -trace=off \
    -reqSizeBytes=1,1048576 -respSizeBytes=1,1048576 -networkMode=Local \
    -opencensus-client-stats=true -resultFile=enabled > $benchmarksOutFile

# 3. Now switch back the branches
git checkout $originalBranch
cd $beginPwd
echo "Wrote benchmarks to: $benchmarksOutFile"