forked from jchavanton/voip_patrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·69 lines (54 loc) · 1.28 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
SESSION=$USER
SERVER="$1"
ulimit -c unlimited
if [ "$1" == "stop" ]
then
tmux kill-session -t $SESSION
exit
fi
if [ "$1" = "" ]
then
echo "missing server argument."
exit
fi
# clean result files
rm *.json
tmux kill-session -t $SESSION
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'Logs'
tmux split-window -h
run_voip_patrol () {
P=$((${ID}+1))
DELAY=$(((${ID}-1)*2))
ENVS="VP_ENV_SERVER=\"${SERVER}\" VP_ENV_CALLEE=\"perf_callee${ID}@${SERVER}\" VP_ENV_U=perf_callee${ID} "
CMD="sleep ${DELAY} && ../voip_patrol -p ${P}000 -c load.xml -o perf${ID}.json --rtp-port ${ID}0010"
# echo "$ENVS bash -c \"$CMD\""
tmux send-keys "${ENVS} bash -c \"${CMD}\"" Enter
}
# start a voip_patrol
tmux select-pane -t 0
ID=1
run_voip_patrol
tmux split-window -v
# start a voip_patrol
tmux select-pane -t 1
ID=2
run_voip_patrol
tmux select-pane -t 2
tmux send-keys "htop" C-m
tmux split-window -v
# start a voip_patrol
tmux select-pane -t 3
ID=3
run_voip_patrol
tmux split-window -v
# start a voip_patrol
tmux select-pane -t 4
ID=4
run_voip_patrol
# Set default window
tmux select-window -t $SESSION:3
# Attach to session
tmux -2 attach-session -t $SESSION
echo "grep \"action\\\": \\\"call\\\"\" --no-filename perf[1-4].json | jq . | grep mos_lq | sort | uniq -c"