mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Function reuse
This commit is contained in:
parent
19fcf84d46
commit
68e9c4dd5d
10
bench.sh
10
bench.sh
@ -82,6 +82,10 @@ speed_v6() {
|
|||||||
speed_test_v6 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP'
|
speed_test_v6 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io_test() {
|
||||||
|
(dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//'
|
||||||
|
}
|
||||||
|
|
||||||
clear
|
clear
|
||||||
next
|
next
|
||||||
echo "CPU model : $cname"
|
echo "CPU model : $cname"
|
||||||
@ -107,9 +111,9 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
io1=$((dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//')
|
io1=$( io_test )
|
||||||
io2=$((dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//')
|
io2=$( io_test )
|
||||||
io3=$((dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//')
|
io3=$( io_test )
|
||||||
ioraw1=$( echo $io1 | awk 'NR==1 {print $1}' )
|
ioraw1=$( echo $io1 | awk 'NR==1 {print $1}' )
|
||||||
ioraw2=$( echo $io2 | awk 'NR==1 {print $1}' )
|
ioraw2=$( echo $io2 | awk 'NR==1 {print $1}' )
|
||||||
ioraw3=$( echo $io3 | awk 'NR==1 {print $1}' )
|
ioraw3=$( echo $io3 | awk 'NR==1 {print $1}' )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user