Skip to content

Commit

Permalink
feature: choose benchmark binary to test local modifications (#2872)
Browse files Browse the repository at this point in the history
Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Jan 17, 2024
1 parent 200e590 commit 3bb19db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions skptesting/benchmark-proxy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#! /bin/bash

source "${GOPATH}/src/github.com/zalando/skipper/skptesting/benchmark.inc"

if [ "$1" == -help ]; then
log benchmark-proxy.sh [duration] [connections] [warmup-duration]
log "benchmark-proxy.sh [duration] [connections] [warmup-duration] [skipper-binary]"
exit 0
fi

source $GOPATH/src/github.com/zalando/skipper/skptesting/benchmark.inc

check_deps

trap cleanup-exit SIGINT
Expand Down
13 changes: 10 additions & 3 deletions skptesting/benchmark.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ if [ -z "$c" ]; then c=128; fi
wd=$3
if [ -z "$wd" ]; then wd=3; fi

# skipper binary to use
bin=$4
if [ -z "$bin" ]
then
go install github.com/zalando/skipper/cmd/skipper@latest
if [ $? -ne 0 ]; then exit -1; fi
bin="${GOBIN}/skipper"
fi

cwd=$GOPATH/src/github.com/zalando/skipper/skptesting
cd $cwd
GO111MODULE=on go install github.com/zalando/skipper/...
if [ $? -ne 0 ]; then exit -1; fi

loremHead='<!doctype html>
<html>
Expand Down Expand Up @@ -71,7 +78,7 @@ skp() {
tokeninfo_url=http://localhost:9999
fi

skipper -access-log-disabled -address "$1" -routes-file "$cwd"/"$2" -insecure \
$bin -access-log-disabled -address "$1" -routes-file "$cwd"/"$2" -insecure \
-support-listener :0 \
-oauth2-tokeninfo-url "$tokeninfo_url" \
-idle-conns-num "$c" -close-idle-conns-period=3s \
Expand Down

0 comments on commit 3bb19db

Please sign in to comment.