forked from jharriga/GCrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemptyCluster.sh
60 lines (49 loc) · 1.73 KB
/
emptyCluster.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
#!/bin/bash
# EmptyCLUSTER.sh
myPath="${BASH_SOURCE%/*}"
if [[ ! -d "$myPath" ]]; then
myPath="$PWD"
fi
# Variables
source "$myPath/vars.shinc"
# Functions
source "$myPath/Utils/functions.shinc"
# Create log file - named in vars.shinc
if [ ! -d $RESULTSDIR ]; then
mkdir -p $RESULTSDIR || \
error_exit "$LINENO: Unable to create RESULTSDIR."
fi
touch $LOGFILE || error_exit "$LINENO: Unable to create LOGFILE."
updatelog "${PROGNAME} - Created logfile: $LOGFILE" $LOGFILE
# Record STARTING cluster capacity and GC stats
var1=`echo; ceph df | head -n 5`
var2=`echo; ceph df | grep rgw.buckets.data`
updatelog "$var1$var2" $LOGFILE
# Record GC stats
var3=`radosgw-admin gc list --include-all | wc -l`
updatelog "Pending GC's == $var3" $LOGFILE
#### ALTERNATE STATS METHOD
#rawUsed=`ceph df | head -n 3 | tail -n 1 | awk '{print $4}'`
#pendingGC=`radosgw-admin gc list --include-all | wc -l`
#date
#echo "Starting statistics:"
#echo " %RAW USED ${rawUsed} : Pending GCs ${pendingGC}"
updatelog "START: cosbench launched" $LOGFILE
# Run the COSbench workload to empty the cluster
echo "starting the I/O workload to empty the Ceph cluster"
./Utils/cos.sh ${myPath}/${EMPTYxml} $LOGFILE
# Record ENDING cluster capacity and GC stats
var1=`echo; ceph df | head -n 5`
var2=`echo; ceph df | grep rgw.buckets.data`
updatelog "$var1$var2" $LOGFILE
# Record GC stats
var3=`radosgw-admin gc list --include-all | wc -l`
updatelog "Pending GC's == $var3" $LOGFILE
# waits for number of pending GCs to reach 1
Utils/completedGC.sh "${pollinterval}" "${LOGFILE}"
# Record ENDING cluster capacity and GC stats
var1=`echo; ceph df | head -n 5`
var2=`echo; ceph df | grep rgw.buckets.data`
updatelog "$var1$var2" $LOGFILE
updatelog "$PROGNAME: Done" $LOGFILE
# DONE