-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_performance.sh
More file actions
executable file
·59 lines (49 loc) · 1.07 KB
/
test_performance.sh
File metadata and controls
executable file
·59 lines (49 loc) · 1.07 KB
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
#!/bin/bash
#
# Tests the performance of the Uniform Reliable Broadcast application.
#
# usage: ./test_performance evaluation_time
#
# evaluation_time: Specifies the number of seconds the application
# should run.
#
evaluation_time=$1
init_time=2
echo "127.0.0.1 11001
127.0.0.1 11002
127.0.0.1 11003
127.0.0.1 11004
127.0.0.1 11005" >> membership
#start 5 processes
for i in `seq 1 5`
do
./da_proc $i membership &
da_proc_id[$i]=$!
done
#leave some time for process initialization
sleep $init_time
#start broadcasting
echo "Evaluating application for ${evaluation_time} seconds."
for i in `seq 1 5`
do
if [ -n "${da_proc_id[$i]}" ]; then
kill -USR1 "${da_proc_id[$i]}"
fi
done
#let the processes do the work for some time
sleep $evaluation_time
#stop all processes
for i in `seq 1 5`
do
if [ -n "${da_proc_id[$i]}" ]; then
kill -TERM "${da_proc_id[$i]}"
fi
done
#wait until all processes stop
for i in `seq 1 5`
do
wait "${da_proc_id[$i]}"
done
#count delivered messages in the logs
#... (not implemented here)
echo "Performance test done."