- local t1=0
- local t2=0
- local t3=0
- local diff
-
- for i in $(seq 1 3);
- do
- echo "Create performance, iteration $i, $numfiles files x 3"
-
- time1=$(create_perf $plaindir $numfiles)
- echo "iter $i: $numfiles creates without pool: $time1"
- t1=$(echo "scale=2; $t1 + $time1" | bc)
-
- create_pool_nofail $POOL > /dev/null
- add_pool $POOL $TGT_ALL "$TGT_UUID" > /dev/null
- create_dir $pooldir $POOL
- time2=$(create_perf $pooldir $numfiles)
- echo "iter $i: $numfiles creates with pool: $time2"
- t2=$(echo "scale=2; $t2 + $time2" | bc)
-
- destroy_pool $POOL > /dev/null
- time3=$(create_perf $pooldir $numfiles)
- echo "iter $i: $numfiles creates with missing pool: $time3"
- t3=$(echo "scale=2; $t3 + $time3" | bc)
-
- echo
- done
-
- time1=$(echo "scale=2; $t1 / $i" | bc)
- echo Avg time taken for $numfiles creates without pool: $time1
- time2=$(echo "scale=2; $t2 / $i" | bc)
- echo Avg time taken for $numfiles creates with pool: $time2
- time3=$(echo "scale=2; $t3 / $i" | bc)
- echo Avg time taken for $numfiles creates with missing pool: $time3
-
- # Set this high until we establish a baseline for what the degradation
- # is / should be
- max=30
- diff=$(echo "scale=2; ($time2 - $time1) * 100 / $time1" | bc)
- echo "No pool to wide pool: $diff %."
- deg=$(echo "scale=2; $diff > $max" | bc)
- [ "$deg" == "1" ] && error_ignore 23408 "Degradation with wide pool is $diff % (> $max %)"
-
- max=15
- diff=$(echo "scale=2; ($time3 - $time1) * 100 / $time1" | bc)
- echo "No pool to missing pool: $diff %."
- deg=$(echo "scale=2; $diff > $max" | bc)
- [ "$deg" == "1" ] && error_ignore 23408 "Degradation with missing pool is $diff % (> $max %)"
+ local f1=0
+ local f2=0
+ local f3=0
+ local diff
+
+ for i in $(seq 1 $iter); do
+ echo "Create performance, iteration $i, $numsec seconds x 3"
+
+ files1=$(create_perf $plaindir $numsec)
+ echo "iter $i: $files1 creates without pool"
+ f1=$(($f1 + $files1))
+
+ create_pool_nofail $POOL > /dev/null
+ add_pool $POOL $TGT_ALL "$TGT_UUID" > /dev/null
+ create_dir $pooldir $POOL
+ files2=$(create_perf $pooldir $numsec)
+ echo "iter $i: $files2 creates with pool"
+ f2=$(($f2 + $files2))
+
+ destroy_pool $POOL > /dev/null
+ files3=$(create_perf $pooldir $numsec)
+ echo "iter $i: $files3 creates with missing pool"
+ f3=$(($f3 + $files3))
+
+ echo
+ done
+
+ echo Avg files created in $numsec seconds without pool: $((files1 / iter))
+ echo Avg files created in $numsec seconds with pool: $((files2 / iter))
+ echo Avg files created in $numsec seconds missing pool: $((files3 / iter))
+
+ # Set this high until we establish a baseline for what the degradation
+ # is / should be
+ max=30
+ diff=$((($files1 - $files2) * 100 / $files1))
+ echo "No pool / wide pool: $diff %."
+ [ $diff -gt $max ] &&
+ error_ignore 23408 "Degradation with wide pool is $diff% > $max%"
+
+ max=30
+ diff=$((($files1 - $files3) * 100 / $files1))
+ echo "No pool / missing pool: $diff %."
+ [ $diff -gt $max ] &&
+ error_ignore 23408 "Degradation with wide pool is $diff% > $max%"