-
Notifications
You must be signed in to change notification settings - Fork 0
/
massfio.sh
executable file
·42 lines (38 loc) · 1.08 KB
/
massfio.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
#!/bin/bash
# Usage: massfio <fio_config.ini> <nodes>
if ! [ -f "$1" ]; then
echo "massfio: job file $1 is not exist!"
echo "Usage: massfio <fio_config.ini> <nodes>"
exit 1
fi
trap 'kill $(jobs -p); echo;' EXIT
rm -f results/errors.log
for client in "${@:2}"; do
mkdir -p "results/$client"
#while [ $? == 0 ]; do
while true; do
fio --alloc-size=kb --output "results/$client/$(date +"%m-%d-%Y-%T").txt" --client "$client" "$1" > /dev/null 2>> results/errors.log
done &
done
while true; do
printf "\033c"
echo "---------"
echo "| Total |"
echo "---------"
echo
echo "Jobs: $(ps T | grep fio | grep -v 'massfio\|grep' | wc -l)"
echo "Errors: " $(cat results/errors.log | grep -v "Connection refused" | wc -l)
echo
echo "-------------"
echo "| last jobs |"
echo "-------------"
echo
ps T | grep fio | grep -v 'massfio\|grep' | tail -n 10
echo
echo "---------------"
echo "| last errors |"
echo "---------------"
echo
tail -n 10 results/errors.log | grep -v "Connection refused"
sleep 2
done