Skip to content

Instantly share code, notes, and snippets.

@pavelmash
Last active July 24, 2022 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelmash/80f4d65b098250f823b717cfea0a4b60 to your computer and use it in GitHub Desktop.
Save pavelmash/80f4d65b098250f823b717cfea0a4b60 to your computer and use it in GitHub Desktop.
Emulate TechEmpower VERIFY load
# This script emulate TechEmpower load during VERIFY stage
# All commands MUST ends in 20sec, otherwise verification is fail
# Expectation:
# - SIEGE 4.0.4 (https://www.joedog.org/siege-home/) to be installed; On Ubuntu: `sudo apt install siege`
# - `tfb-server` can be resolved (added to /etc/hosts for example)
# - .siegerc can be downloaded here - https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/databases/.siegerc
# Real value is 20s, if your host is fast - set lower value, 3s is ok for Ryzen5 5600
TIMEOUT="3s"
err_report() {
>&2 echo "Error in $0 on line $1"
script_aborted
}
trap 'err_report $LINENO' ERR
script_successful(){
echo "++success++"
exit 0
}
script_aborted() {
echo "******fails******"
exit 1
}
set -o pipefail
declare -a arr=(
"http://tfb-server:8080/db"
"http://tfb-server:8080/json"
"http://tfb-server:8080/queries?queries=2"
"http://tfb-server:8080/queries?queries=0"
"http://tfb-server:8080/queries?queries=foo"
"http://tfb-server:8080/queries?queries=501"
"http://tfb-server:8080/queries?queries="
"http://tfb-server:8080/updates?queries=2"
"http://tfb-server:8080/updates?queries=0"
"http://tfb-server:8080/updates?queries=foo"
"http://tfb-server:8080/updates?queries=501"
"http://tfb-server:8080/updates?queries="
"http://tfb-server:8080/fortunes"
"http://tfb-server:8080/plaintext"
"http://tfb-server:8080/cached-queries?count=2"
"http://tfb-server:8080/cached-queries?count=0"
"http://tfb-server:8080/cached-queries?count=foo"
"http://tfb-server:8080/cached-queries?count=501"
"http://tfb-server:8080/cached-queries?count="
)
for i in "${arr[@]}"
do
echo "# $i"
/usr/bin/time -f "+++Test duration %e+++" timeout -v $TIMEOUT siege -c 512 -r 2 "$i" -R ~/dev/FrameworkBenchmarks/toolset/databases/.siegerc
echo ""
done
script_successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment