From 20bc1785d0c1f6f4a49dd15772e52bc8d37a8045 Mon Sep 17 00:00:00 2001 From: rand00 Date: Thu, 12 Jan 2023 16:58:26 +0100 Subject: [PATCH] Perftest: Fixed plot script semantics + made perftest.sh work with args given from builder-web ++ --- packaging/perftest.sh | 8 +++---- packaging/perftest/unipi/plot.sh | 40 ++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/packaging/perftest.sh b/packaging/perftest.sh index 7420a89..52b7403 100755 --- a/packaging/perftest.sh +++ b/packaging/perftest.sh @@ -88,9 +88,10 @@ done [ -z "${CACHE_DIR}" ] && die "The --cache-dir option must be specified" [ -z "${DATA_DIR}" ] && die "The --data-dir option must be specified" -BIN_REL="$1" -[ -z "${BIN_REL}" ] && \ +BIN="$1" +[ -z "${BIN}" ] && \ die "The main binarys localpath must be given as the first positional argument" +BIN_EXT=$(echo "$BIN" | sed 's/.*\.\(.*\)/\1/') # >>> CONFIGURE PER SYSTEM SERVER="starand" @@ -99,9 +100,6 @@ SERVER_DIR="0tmp/robur_perftest" info "processing UUID '$UUID'" -BIN="${DATA_DIR}/$BIN_REL" -BIN_EXT=$(echo "$BIN_REL" | sed 's/.*\.\(.*\)/\1/') - DB="${DATA_DIR}/builder.sqlite3" DB="${DATA_DIR}/builder.sqlite3" diff --git a/packaging/perftest/unipi/plot.sh b/packaging/perftest/unipi/plot.sh index a2ceb78..e6cd1c7 100755 --- a/packaging/perftest/unipi/plot.sh +++ b/packaging/perftest/unipi/plot.sh @@ -2,6 +2,29 @@ set -e +prog_NAME=$(basename "${0}") + +warn() +{ + echo "${prog_NAME}: WARN: $*" +} + +info() +{ + echo "${prog_NAME}: INFO: $*" +} + +err() +{ + echo "${prog_NAME}: ERROR: $*" 1>&2 +} + +die() +{ + echo "${prog_NAME}: ERROR: $*" 1>&2 + exit 1 +} + PERFJOB_DIR="$1" CACHE_DIR="$2" DB="$3" @@ -14,11 +37,12 @@ COLS=5,7,8 #resp-time, throughput, concurrent DAT="${PERFJOB_DIR}/tmp.dat" +#> Note: ordering desc for plot ordering left->right get_jobs_build-uuids () { sqlite3 "$DB" "select b.uuid from build as b \ join job as j on j.id = b.job\ where j.name = '$JOB' \ - order by b.id asc" + order by b.id desc" } get_bin_hash () { @@ -36,20 +60,22 @@ while read -r UUID; do CSV="${PERFJOB_DIR}/${BIN_SHA256}/siege_test01.csv" if [ ! -f "$CSV" ]; then - echo "Skipping build with uuid '$UUID'. Test-data doesn't exist: '$CSV'" + info "Skipping build with uuid '$UUID'. Test-data doesn't exist: '$CSV'" continue fi - if [ $N = 1 ]; then - echo -n "# Build UUID - " + if [ $N = 0 ]; then + echo -n "# Build UUID - " > "$DAT" cat "$CSV" | head -n1 | cut -d, -f"$COLS" \ | sed 's/,//g' \ | sed 's/ \+//' \ | sed 's/\( \+\)/ -\1/g' \ - > "$DAT" + >> "$DAT" fi - #goto validate csv file, and on invalid: append error-data instead + #goto validate csv file, and on invalid: append error-data instead + + info appending line from "$CSV" of uuid "$UUID" echo -n "$UUID " >> "$DAT" cat "$CSV" | tail +2 | cut -d, -f"$COLS" \ @@ -77,4 +103,4 @@ set style data histograms plot '$DAT' using 3:xtic(1) EOF -rm "$DAT" +#rm "$DAT"