From 2b4968aff9f71de7b8c49c768a06c76956f35259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 23 Feb 2013 04:49:26 +0000 Subject: [PATCH] Possibility to plot several tests on the same plot This allows comparing benchmarks with each other. For example, it is very convenient to visualise on the same graph how throughput changes when {concurrent, N} changes. --- README.org | 5 ++++- priv/gp_latencies.sh | 36 ++++++++++++++++++++++-------------- priv/gp_throughput.sh | 19 ++++++++++++++----- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index e63f355ba..50e049354 100644 --- a/README.org +++ b/README.org @@ -109,7 +109,8 @@ $ ./priv/gp_latency.sh Some of options for these scripts are: - - =-d TEST_DIR= : directory which include test result CSV files + - =-d TEST_DIR= : comma-separated list of directories which include + test result CSV files - =-t TERMINAL_TYPE= : gnuplot terminal type - =-P= : just print gnuplot script without drawing graph @@ -117,6 +118,8 @@ $ ./priv/gp_latency.sh by the option =-t dumb=, which is useful in non-graphical environment or quick sharing of result in chat. + Also, you can plot multiple test runs on a single plot by using "-d" switch. + ** Contributing We encourage contributions to Basho Bench from the community. diff --git a/priv/gp_latencies.sh b/priv/gp_latencies.sh index 9c2910bf6..0ae0b4d37 100755 --- a/priv/gp_latencies.sh +++ b/priv/gp_latencies.sh @@ -60,24 +60,27 @@ done function plot_command(){ echo "plot \\" - if [ -z "${OPERATIONS}" ]; then - for f in `ls ${TEST_DIR}/*_latencies.csv` - do - OPERATION=`basename $f _latencies.csv` - plot_per_op ${OPERATION} - done - else - for OPERATION in ${OPERATIONS//,/ } - do - plot_per_op ${OPERATION} - done - fi + for THIS_TEST_DIR in ${TEST_DIR//,/ } + do + if [ -z "${OPERATIONS}" ]; then + for f in `ls ${THIS_TEST_DIR}/*_latencies.csv` + do + OPERATION=`basename $f _latencies.csv` + plot_per_op ${OPERATION} + done + else + for OPERATION in ${OPERATIONS//,/ } + do + plot_per_op ${OPERATION} + done + fi + done echo " 1/0 notitle # dummy" } function plot_per_op(){ OPERATION=$1 - LATENCY_FILE="${TEST_DIR}/${OPERATION}_latencies.csv" + LATENCY_FILE="${THIS_TEST_DIR}/${OPERATION}_latencies.csv" for KIND in ${STATS_KINDS//,/ } do plot_per_op_kind ${OPERATION} ${LATENCY_FILE} ${KIND} @@ -99,7 +102,12 @@ function plot_per_op_kind() { esac echo " \"${FILE}\" using 1:(\$${COL_POS}/\$2/1000) with \\" echo " ${PLOT_STYLE} \\" - echo " title \"${OPERATION}:${KIND}\" \\" + # If plotting only 1 directory, do not add its name + if [ "${TEST_DIR}" == "${THIS_TEST_DIR}" ]; then + echo " title \"${OPERATION}:${KIND}\" \\" + else + echo " title \"${THIS_TEST_DIR##*/} - ${OPERATION}:${KIND}\" \\" + fi echo " ,\\" } diff --git a/priv/gp_throughput.sh b/priv/gp_throughput.sh index 3227b7611..bd5bc1e83 100755 --- a/priv/gp_throughput.sh +++ b/priv/gp_throughput.sh @@ -5,7 +5,7 @@ function Usage { echo " [-t TERMINAL_TYPE] [-s PLOT_STYLE] [-p PRE_COMMAD]" >&2 echo " [-P] [-h]" >&2 echo "" >&2 - echo " -d TEST_DIR: test directory with summary.csv" >&2 + echo " -d TEST_DIR: comma-separaated test directories with summary.csv" >&2 echo " default: \"tests/current\"" >&2 echo " -k SUMMARY_KINDS: summary kinds in comma separated list" >&2 echo " default: \"total,failed\"" >&2 @@ -54,15 +54,18 @@ done function plot_command(){ echo "plot \\" - for KIND in ${SUMMARY_KINDS//,/ } + for THIS_TEST_DIR in ${TEST_DIR//,/ } do - plot_per_kind ${KIND} + for KIND in ${SUMMARY_KINDS//,/ } + do + plot_per_kind ${KIND} + done done echo " 1/0 notitle # dummy" } function plot_per_kind() { - FILE=${TEST_DIR}/summary.csv + FILE=${THIS_TEST_DIR}/summary.csv case "${KIND}" in "total") COL_POS=3 ;; "successful") COL_POS=4 ;; @@ -71,7 +74,13 @@ function plot_per_kind() { esac echo " \"${FILE}\" using 1:(\$${COL_POS}/\$2) with \\" echo " ${PLOT_STYLE} \\" - echo " title \"${KIND}\" \\" + + # If plotting only 1 directory, do not add its name + if [ "${THIS_DIR}" == "${THIS_TEST_DIR}" ]; then + echo " title \"${KIND}\" \\" + else + echo " title \"${THIS_TEST_DIR##*/} - ${KIND}\" \\" + fi echo " ,\\" }