-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsystem_metrics_collection.sh
More file actions
executable file
·51 lines (35 loc) · 1.02 KB
/
system_metrics_collection.sh
File metadata and controls
executable file
·51 lines (35 loc) · 1.02 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
#!/bin/bash
OUTPUT="system_labels.csv"
echo "start,end,part" >> "$OUTPUT"
echo "Start logging"
./system_metrics_logging.sh &
METRICS_PID=$!
echo "Logging started"
sleep 180
echo "Start probing part 1"
for ((i = 1; i <= 10; i++)); do
echo "Iteration $i:"
timestamp_start=$(date '+%Y-%m-%d %H:%M:%S.%N')
sudo python3 probing.py -i 10 -n --description default
timestamp_end=$(date '+%Y-%m-%d %H:%M:%S.%N')
echo "$timestamp_start,$timestamp_end,1" >> "$OUTPUT"
echo "Sleeping for 1 seconds..."
sleep 10
done
echo "Probing part 1 finished"
sleep 180
echo "Start probing part 2"
for ((i = 1; i <= 10; i++)); do
echo "Iteration $i:"
timestamp_start=$(date '+%Y-%m-%d %H:%M:%S.%N')
sudo python3 probing.py -n --description default
timestamp_end=$(date '+%Y-%m-%d %H:%M:%S.%N')
echo "$timestamp_start,$timestamp_end,2" >> "$OUTPUT"
echo "Sleeping for 1 seconds..."
sleep 10
done
echo "Probing part 2 finished"
sleep 180
kill $METRICS_PID
wait $METRICS_PID 2>/dev/null
echo "Done."