]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/nop-time.sh
Allow calling `make html` when results is a symlink
[can-benchmark.git] / gw-tests / nop-time.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 main() {
6     #Check that the test wasn't skipped.
7     if [ "$(ls -A ../nop)" ]; then
8         #Otherwise this would create *.txt file and plot.sh and break the automation
9         ln -s ../nop/*.txt .
10     else
11         SKIPPED=1; return;
12     fi;
13 }
14
15 ADDITIONAL_PLOTS=detail
16
17 plot_cmds() {
18     if [[ "$1" = detail ]]; then
19         range=0.0:0.3
20     else
21         range=0.01:4
22         echo "set logscale y"
23     fi
24     min=$(head -n 1 len2-msgs.txt | awk '{ print $2 }')
25     cat <<EOF
26 set title "Single GW rule for all messages, no modifications"
27 set grid xtics ytics mytics lw 1, lw 0.5
28 set key left
29 set xlabel "Experiment time [s]"
30 set ylabel "GW latency [ms]"
31 plot [:] [$range] \\
32           "len2-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "2 byte messages", \\
33           "len4-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "4 byte messages", \\
34           "len6-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "6 byte messages", \\
35           "len8-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "8 byte messages"
36 EOF
37 }
38     
39 test_end
40