mirror of
https://github.com/AuxXxilium/yet-another-bench-script.git
synced 2024-11-23 23:01:02 +07:00
Fix locale override
This commit is contained in:
parent
dd591b9251
commit
73844833ce
10
yabs.sh
10
yabs.sh
@ -22,6 +22,9 @@ echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
||||
echo -e
|
||||
date
|
||||
|
||||
# override locale to eliminate parsing errors (i.e. using commas a delimiters rather than periods)
|
||||
export LC_ALL=C
|
||||
|
||||
# gather basic system information (inc. CPU, AES-NI/virt status, RAM + swap + disk size)
|
||||
echo -e
|
||||
echo -e "Basic System Information:"
|
||||
@ -89,14 +92,14 @@ function disk_test {
|
||||
while [ $I -lt 3 ]
|
||||
do
|
||||
# write test using dd, "direct" flag is used to test direct I/O for data being stored to disk
|
||||
DISK_WRITE_TEST=$(LC_ALL=C dd if=/dev/zero of=$DISK_PATH/$DATE.test bs=64k count=16k oflag=direct |& grep copied | awk '{ print $(NF-1) " " $(NF)}')
|
||||
DISK_WRITE_TEST=$(dd if=/dev/zero of=$DISK_PATH/$DATE.test bs=64k count=16k oflag=direct |& grep copied | awk '{ print $(NF-1) " " $(NF)}')
|
||||
VAL=$(echo $DISK_WRITE_TEST | cut -d " " -f 1)
|
||||
[[ "$DISK_WRITE_TEST" == *"GB"* ]] && VAL=$(awk -v a="$VAL" 'BEGIN { print a * 1000 }')
|
||||
DISK_WRITE_TEST_RES+=( "$DISK_WRITE_TEST" )
|
||||
DISK_WRITE_TEST_AVG=$(awk -v a="$DISK_WRITE_TEST_AVG" -v b="$VAL" 'BEGIN { print a + b }')
|
||||
|
||||
# read test using dd using the 1G file written during the write test
|
||||
DISK_READ_TEST=$(LC_ALL=C dd if=$DISK_PATH/$DATE.test of=/dev/null bs=8k |& grep copied | awk '{ print $(NF-1) " " $(NF)}')
|
||||
DISK_READ_TEST=$(dd if=$DISK_PATH/$DATE.test of=/dev/null bs=8k |& grep copied | awk '{ print $(NF-1) " " $(NF)}')
|
||||
VAL=$(echo $DISK_READ_TEST | cut -d " " -f 1)
|
||||
[[ "$DISK_READ_TEST" == *"GB"* ]] && VAL=$(awk -v a="$VAL" 'BEGIN { print a * 1000 }')
|
||||
DISK_READ_TEST_RES+=( "$DISK_READ_TEST" )
|
||||
@ -345,3 +348,6 @@ fi
|
||||
# finished all tests, clean up all YABS files and exit
|
||||
echo -e
|
||||
rm -rf $YABS_PATH
|
||||
|
||||
# reset locale settings
|
||||
unset LC_ALL
|
||||
|
Loading…
Reference in New Issue
Block a user