Add user-time graph
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 12 Dec 2010 22:27:52 +0000 (23:27 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 12 Dec 2010 22:27:52 +0000 (23:27 +0100)
gw-tests/user-time.sh [new file with mode: 0755]

diff --git a/gw-tests/user-time.sh b/gw-tests/user-time.sh
new file mode 100755 (executable)
index 0000000..e981d1a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. lib.sh
+
+NO_GW_NEEDED=true
+
+main() {
+       ln -s ../user/*.txt .
+}
+
+#ADDITIONAL_PLOTS=detail
+
+plot_cmds() {
+    if [[ "$1" = detail ]]; then
+       range=0.06:0.3
+    else
+       range=0.06:800
+       echo "set logscale y"
+    fi
+    if [ -s user2-msgs.txt ]; then
+       min=$(head -n 1 user2-msgs.txt | awk '{ print $2 }')
+    else
+       min=$(head -n 1 user8-msgs.txt | awk '{ print $2 }')
+    fi
+    cat <<EOF
+set title "Single GW job for all messages, no modifications"
+set grid xtics ytics mytics lw 1, lw 0.5
+set xlabel "Time [s]"
+set ylabel "Latency [ms]"
+plot [:] [$range] \
+          "user2-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Userspace GW, 2 byte messages", \
+          "user8-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Userspace GW, 8 byte messages", \
+          "kern2-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Kernel GW, 2 byte messages", \
+          "kern8-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Kernel GW, 8 byte messages"
+EOF
+}
+    
+test_end
+