Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: choose benchmark binary to test local modifications #2872

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this moved due to missing log()?

The downside is that benchmark.inc now installs skipper even if someone just ran it with -help

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just change it to echo ""benchmark-proxy.sh [duration] ..." >&2. I think it may also print to stdout since its not an error but help message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is required to use log()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it does not hurt to install a current local skipper


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