mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Fixed function io_test adapt to the Chinese environment (#124)
This commit is contained in:
parent
acef6b00a6
commit
1050224c16
8
bench.sh
8
bench.sh
@ -90,7 +90,7 @@ speed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
io_test() {
|
io_test() {
|
||||||
(LANG=C dd if=/dev/zero of=benchtest_$$ bs=512k count="$1" conv=fdatasync && rm -f benchtest_$$) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//'
|
(LANG=C dd if=/dev/zero of=benchtest_$$ bs=512k count="$1" conv=fdatasync && rm -f benchtest_$$) 2>&1 | awk -F '[,,]' '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//'
|
||||||
}
|
}
|
||||||
|
|
||||||
calc_size() {
|
calc_size() {
|
||||||
@ -373,11 +373,11 @@ print_io_test() {
|
|||||||
io3=$(io_test ${writemb})
|
io3=$(io_test ${writemb})
|
||||||
echo " I/O Speed(3rd run) : $(_yellow "$io3")"
|
echo " I/O Speed(3rd run) : $(_yellow "$io3")"
|
||||||
ioraw1=$(echo "$io1" | awk 'NR==1 {print $1}')
|
ioraw1=$(echo "$io1" | awk 'NR==1 {print $1}')
|
||||||
[ "$(echo "$io1" | awk 'NR==1 {print $2}')" == "GB/s" ] && ioraw1=$(awk 'BEGIN{print '"$ioraw1"' * 1024}')
|
[[ "$(echo "$io1" | awk 'NR==1 {print $2}')" == "GB/s" ]] && ioraw1=$(awk 'BEGIN{print '"$ioraw1"' * 1024}')
|
||||||
ioraw2=$(echo "$io2" | awk 'NR==1 {print $1}')
|
ioraw2=$(echo "$io2" | awk 'NR==1 {print $1}')
|
||||||
[ "$(echo "$io2" | awk 'NR==1 {print $2}')" == "GB/s" ] && ioraw2=$(awk 'BEGIN{print '"$ioraw2"' * 1024}')
|
[[ "$(echo "$io2" | awk 'NR==1 {print $2}')" == "GB/s" ]] && ioraw2=$(awk 'BEGIN{print '"$ioraw2"' * 1024}')
|
||||||
ioraw3=$(echo "$io3" | awk 'NR==1 {print $1}')
|
ioraw3=$(echo "$io3" | awk 'NR==1 {print $1}')
|
||||||
[ "$(echo "$io3" | awk 'NR==1 {print $2}')" == "GB/s" ] && ioraw3=$(awk 'BEGIN{print '"$ioraw3"' * 1024}')
|
[[ "$(echo "$io3" | awk 'NR==1 {print $2}')" == "GB/s" ]] && ioraw3=$(awk 'BEGIN{print '"$ioraw3"' * 1024}')
|
||||||
ioall=$(awk 'BEGIN{print '"$ioraw1"' + '"$ioraw2"' + '"$ioraw3"'}')
|
ioall=$(awk 'BEGIN{print '"$ioraw1"' + '"$ioraw2"' + '"$ioraw3"'}')
|
||||||
ioavg=$(awk 'BEGIN{printf "%.1f", '"$ioall"' / 3}')
|
ioavg=$(awk 'BEGIN{printf "%.1f", '"$ioall"' / 3}')
|
||||||
echo " I/O Speed(average) : $(_yellow "$ioavg MB/s")"
|
echo " I/O Speed(average) : $(_yellow "$ioavg MB/s")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user