]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/nop-canalyzer.sh
Changed graphs to be more internally consistent.
[can-benchmark.git] / gw-tests / nop-canalyzer.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 COUNT=2500
6
7 wait_for_key() {
8     [ "$INTERACTIVE" ] && read -p "Press a key to continue" || :
9 }
10
11 main() {
12     if ! [ "$INTERACTIVE" ]; then echo "Skipping interactive test $0"; SKIPPED=1; return; fi
13
14     sshgw cangw -A -s can0 -d can1
15     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n len2
16     wait_for_key
17     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -n len4
18     wait_for_key
19     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -n len6
20     wait_for_key
21     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n len8
22 }
23
24 ADDITIONAL_PLOTS=detail
25
26 plot_cmds() {
27     if [[ "$1" = detail ]]; then
28         range=0.06:0.4
29         echo "set logscale y"
30     else
31         range=0.05:100
32         echo "set logscale xy"
33     fi
34     cat <<EOF
35 set title "Measurment precission: PC versus CANalyzer"
36 set termoption dashed
37 set grid xtics mxtics ytics mytics lw 1, lw 0.5
38 set xlabel "Total latency [ms]"
39 set ylabel "Latency profile [frames]"
40 plot [$range] [1:$COUNT] \\
41           "len2-hist.txt" with lp lc 1 lt 1 title "PC: 2 byte messages", \\
42           "len4-hist.txt" with lp lc 2 lt 1 title "PC: 4 byte messages", \\
43           "len6-hist.txt" with lp lc 3 lt 1 title "PC: 6 byte messages", \\
44           "len8-hist.txt" with lp lc 4 lt 1 title "PC: 8 byte messages", \\
45           "canalyzer-2-hist.txt" with lp lc 1 lt 2 title "CANalyzer: 2 byte messages", \\
46           "canalyzer-4-hist.txt" with lp lc 2 lt 2 title "CANalyzer: 4 byte messages", \\
47           "canalyzer-6-hist.txt" with lp lc 3 lt 2 title "CANalyzer: 6 byte messages", \\
48           "canalyzer-8-hist.txt" with lp lc 4 lt 2 title "CANalyzer: 8 byte messages"
49 EOF
50 }
51     
52 test_end
53