go.ligato.io/vpp-agent/v3@v3.5.0/scripts/run_perf_test.sh (about) 1 #!/usr/bin/env bash 2 set -euo pipefail 3 4 # usage: ./scripts/run_perf_test.sh <num_req> <num_tunnels_per_req> <num_clients> 5 6 num_req=${1-10000} 7 8 image=${AGENT_IMG:-ligato/dev-vpp-agent} 9 reports=${REPORT_DIR:-report} 10 profiling_mode=${PROF_MODE-} 11 12 reports="$(cd $reports && pwd)" 13 14 runid=${RUN-"${num_req}-req"} 15 results="${reports}/perf-results-${runid}" 16 17 mkdir -p "$results" 18 19 echo "Starting perf test run: $runid" 20 21 cid=$(docker run -d -it --privileged \ 22 --label perf-run="$runid" \ 23 -v "$results":/report \ 24 -e REPORT_DIR=/report \ 25 -e ETCD_CONFIG=disabled \ 26 -e INITIAL_LOGLVL=info \ 27 -e DEBUG_ENABLED=y \ 28 -e DEBUG_PROFILE_MODE="$profiling_mode" \ 29 ${DOCKER_EXTRA_ARGS:-} \ 30 -- \ 31 "$image" /bin/bash \ 32 ) 33 34 function on_exit() { 35 docker stop -t 1 "$cid" 36 exit 37 } 38 trap 'on_exit' EXIT 39 40 docker exec -it "$cid" bash ./tests/perf/perf_test.sh grpc-perf $* 41 42 echo "Test results stored in: $results"