tor_multipath_voip/scripts/parse_lib.sh

88 lines
2.8 KiB
Bash
Raw Normal View History

2019-09-05 12:45:28 +00:00
get_xp() {
grep -rn "identifier=$1" ./out/*/info.txt|grep -Po "^./out/\w+"|grep -Po '\w+$$'|uniq
}
2019-09-14 14:26:57 +00:00
is_measurement_done() {
grep -q 'Measurement done' ./out/$1-$2/res/*.csv
}
2019-09-05 12:45:28 +00:00
extract_us() {
2019-09-17 09:22:58 +00:00
cat ./out/$1-$2/res/*.csv | grep -P "Packet (\d+) latency (\d+)" | perl -pe's/^.*Packet (\d+) latency (\d+).*$/$2,$1/'
2019-09-05 12:45:28 +00:00
}
2019-09-05 12:54:54 +00:00
parse_latency() {
2019-09-17 17:52:02 +00:00
echo "run,conf,latency,ident"
2019-09-05 12:54:54 +00:00
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
2019-09-17 17:52:02 +00:00
extract_us $r $i | while read l; do
2019-09-05 12:54:54 +00:00
echo $r,$i,$l;
done
done
done
}
2019-09-14 14:26:57 +00:00
parse_thunder() {
2019-09-16 23:30:43 +00:00
echo "run,jmax,links,latency,ident"
2019-09-14 14:26:57 +00:00
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
links=$(grep -Po "thunder-server \d+" out/$r-$i/info.txt|grep -Po "\d+$")
jmax=$(grep -Po "thunder-server \d+ \d+" out/$r-$i/info.txt|grep -Po "\d+$")
is_measurement_done $r $i && extract_us $r $i | while read l; do
echo $r,$jmax,$links,$l;
done
done
done
}
2019-09-16 06:54:22 +00:00
parse_thunder_bw() {
echo "run,jmax,links,udp_sent,udp_rcv,cells_sent,cells_rcv"
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
links=$(grep -Po "thunder-server \d+" out/$r-$i/info.txt|grep -Po "\d+$")
jmax=$(grep -Po "thunder-server \d+ \d+" out/$r-$i/info.txt|grep -Po "\d+$")
udp_sent=$(grep -Po "udp_sent: \d+" out/$r-$i/log/client-donar-stdout.log|grep -Po "\d+$")
udp_rcv=$(grep -Po "udp_rcv: \d+" out/$r-$i/log/client-donar-stdout.log|grep -Po "\d+$")
cells_sent=$(grep -Po "cells_sent: \d+" out/$r-$i/log/client-donar-stdout.log|grep -Po "\d+$")
cells_rcv=$(grep -Po "cells_rcv: \d+" out/$r-$i/log/client-donar-stdout.log|grep -Po "\d+$")
[ -n "$udp_sent" ] && [ -n "$udp_rcv" ] && [ -n "$cells_sent" ] && [ -n "$cells_rcv" ] && \
echo "$r,$jmax,$links,$udp_sent,$udp_rcv,$cells_sent,$cells_rcv"
done
done
}
2019-09-16 16:09:41 +00:00
parse_thunder_links() {
2019-09-16 20:53:34 +00:00
echo "run,ts,link_id,status,delta,duration,will_change,xp_time,durations_global,will_change_global"
2019-09-16 16:09:41 +00:00
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
2019-09-17 06:33:55 +00:00
grep -q 'thunder-client 9900 30 100 8 450' out/$r-$i/info.txt && cat out/$r-$i/log/client-donar-stdout.log | ./links_parse.py $r-$i || true
2019-09-16 16:09:41 +00:00
done
done
}
2019-09-17 08:52:54 +00:00
parse_thunder_drop() {
2019-09-17 09:18:42 +00:00
echo "run,packet_range,count"
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
cat out/$r-$i/res/thunder.csv | ./drop_parse.py 990 9900 $r-$i || true
done
done
2019-09-17 08:52:54 +00:00
}
parse_thunder_drop_burst() {
2019-09-17 09:18:42 +00:00
echo "run,prev,cur,count"
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
2019-09-17 09:22:58 +00:00
cat out/$r-$i/res/thunder.csv | ./drop_burst_parse.py $r-$i || true
2019-09-17 09:18:42 +00:00
done
done
2019-09-17 08:52:54 +00:00
}
parse_thunder_red() {
echo "run,delivered_at_once,occur"
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
2019-09-17 09:22:58 +00:00
grep -Po "Delivered \d+ packets" out/$r-$i/log/client-donar-stdout.log | grep -Po "\d+"|sort|uniq -c|perl -pe"s/^\s*(\d+)\s+(\d+)$/$r-$i,\$2,\$1/"
2019-09-17 08:52:54 +00:00
done
done
}