Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.
  • Loading branch information...
commit 01c53b1ec4744dbc018e5fcb6d6b2adc151c3797 1 parent 1ea1570
Motiejus Jakštys authored shino committed
5  README.org
Source Rendered
@@ -109,7 +109,8 @@ $ ./priv/gp_latency.sh
109 109
 
110 110
    Some of options for these scripts are:
111 111
 
112  
-   - =-d TEST_DIR= : directory which include test result CSV files
  112
+   - =-d TEST_DIR= : comma separated list of directories which include
  113
+         test result CSV files
113 114
    - =-t TERMINAL_TYPE= : gnuplot terminal type
114 115
    - =-P= : just print gnuplot script without drawing graph
115 116
 
@@ -117,6 +118,8 @@ $ ./priv/gp_latency.sh
117 118
    by the option =-t dumb=, which is useful in non-graphical
118 119
    environment or quick sharing of result in chat.
119 120
 
  121
+   Also, you can plot multiple test runs on a single plot by using "-d" switch.
  122
+
120 123
 ** Contributing
121 124
    We encourage contributions to Basho Bench from the community.
122 125
 
38  priv/gp_latencies.sh
@@ -5,7 +5,7 @@ function Usage {
5 5
   echo "                       [-t TERMINAL_TYPE] [-s PLOT_STYLE] [-p PRE_COMMAD]" >&2
6 6
   echo "                       [-P] [-h]" >&2
7 7
   echo "" >&2
8  
-  echo "    -d TEST_DIR:      test directory with *-latencies.csv" >&2
  8
+  echo "    -d TEST_DIR:      comma separated test directories with *-latencies.csv" >&2
9 9
   echo "                      default: \"tests/current\"" >&2
10 10
   echo "    -o OPERATIONS:    operation prefixes of *-latencies.csv" >&2
11 11
   echo "                      in comma separated list" >&2
@@ -60,24 +60,27 @@ done
60 60
 
61 61
 function plot_command(){
62 62
     echo "plot \\"
63  
-    if [ -z "${OPERATIONS}" ]; then
64  
-        for f in `ls ${TEST_DIR}/*_latencies.csv`
65  
-        do
66  
-            OPERATION=`basename $f _latencies.csv`
67  
-            plot_per_op ${OPERATION}
68  
-        done
69  
-    else
70  
-        for OPERATION in ${OPERATIONS//,/ }
71  
-        do
72  
-            plot_per_op ${OPERATION}
73  
-        done
74  
-    fi
  63
+    for THIS_TEST_DIR in ${TEST_DIR//,/ }
  64
+    do
  65
+        if [ -z "${OPERATIONS}" ]; then
  66
+            for f in `ls ${THIS_TEST_DIR}/*_latencies.csv`
  67
+            do
  68
+                OPERATION=`basename $f _latencies.csv`
  69
+                plot_per_op ${OPERATION}
  70
+            done
  71
+        else
  72
+            for OPERATION in ${OPERATIONS//,/ }
  73
+            do
  74
+                plot_per_op ${OPERATION}
  75
+            done
  76
+        fi
  77
+    done
75 78
     echo "    1/0 notitle # dummy"
76 79
 }
77 80
 
78 81
 function plot_per_op(){
79 82
     OPERATION=$1
80  
-    LATENCY_FILE="${TEST_DIR}/${OPERATION}_latencies.csv"
  83
+    LATENCY_FILE="${THIS_TEST_DIR}/${OPERATION}_latencies.csv"
81 84
     for KIND in ${STATS_KINDS//,/ }
82 85
     do
83 86
         plot_per_op_kind ${OPERATION} ${LATENCY_FILE} ${KIND}
@@ -99,7 +102,12 @@ function plot_per_op_kind() {
99 102
     esac
100 103
     echo "    \"${FILE}\" using 1:(\$${COL_POS}/\$2/1000) with \\"
101 104
     echo "        ${PLOT_STYLE} \\"
102  
-    echo "        title \"${OPERATION}:${KIND}\" \\"
  105
+    # If plotting only 1 directory, do not add its name
  106
+    if [ "${TEST_DIR}" == "${THIS_TEST_DIR}" ]; then
  107
+        echo "        title \"${OPERATION}:${KIND}\" \\"
  108
+    else
  109
+        echo "        title \"${THIS_TEST_DIR##*/} - ${OPERATION}:${KIND}\" \\"
  110
+    fi
103 111
     echo "        ,\\"
104 112
 }
105 113
 
19  priv/gp_throughput.sh
@@ -5,7 +5,7 @@ function Usage {
5 5
   echo "                        [-t TERMINAL_TYPE] [-s PLOT_STYLE] [-p PRE_COMMAD]" >&2
6 6
   echo "                        [-P] [-h]" >&2
7 7
   echo "" >&2
8  
-  echo "    -d TEST_DIR:      test directory with summary.csv" >&2
  8
+  echo "    -d TEST_DIR:      comma separated test directories with summary.csv" >&2
9 9
   echo "                      default: \"tests/current\"" >&2
10 10
   echo "    -k SUMMARY_KINDS: summary kinds in comma separated list" >&2
11 11
   echo "                      default: \"total,failed\"" >&2
@@ -54,15 +54,18 @@ done
54 54
 
55 55
 function plot_command(){
56 56
     echo "plot \\"
57  
-    for KIND in ${SUMMARY_KINDS//,/ }
  57
+    for THIS_TEST_DIR in ${TEST_DIR//,/ }
58 58
     do
59  
-        plot_per_kind ${KIND}
  59
+        for KIND in ${SUMMARY_KINDS//,/ }
  60
+        do
  61
+            plot_per_kind ${KIND}
  62
+        done
60 63
     done
61 64
     echo "    1/0 notitle # dummy"
62 65
 }
63 66
 
64 67
 function plot_per_kind() {
65  
-    FILE=${TEST_DIR}/summary.csv
  68
+    FILE=${THIS_TEST_DIR}/summary.csv
66 69
     case "${KIND}" in
67 70
         "total")      COL_POS=3 ;;
68 71
         "successful") COL_POS=4 ;;
@@ -71,7 +74,13 @@ function plot_per_kind() {
71 74
     esac
72 75
     echo "    \"${FILE}\" using 1:(\$${COL_POS}/\$2) with \\"
73 76
     echo "        ${PLOT_STYLE} \\"
74  
-    echo "        title \"${KIND}\" \\"
  77
+
  78
+    # If plotting only 1 directory, do not add its name
  79
+    if [ "${THIS_DIR}" == "${THIS_TEST_DIR}" ]; then
  80
+        echo "        title \"${KIND}\" \\"
  81
+    else
  82
+        echo "        title \"${THIS_TEST_DIR##*/} - ${KIND}\" \\"
  83
+    fi
75 84
     echo "        ,\\"
76 85
 }
77 86
 

0 notes on commit 01c53b1

Please sign in to comment.
Something went wrong with that request. Please try again.