summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/storage/fio_benchmark.bash
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios/storage/fio_benchmark.bash')
-rw-r--r--yardstick/benchmark/scenarios/storage/fio_benchmark.bash43
1 files changed, 3 insertions, 40 deletions
diff --git a/yardstick/benchmark/scenarios/storage/fio_benchmark.bash b/yardstick/benchmark/scenarios/storage/fio_benchmark.bash
index 0fa319dd4..2ef7f4949 100644
--- a/yardstick/benchmark/scenarios/storage/fio_benchmark.bash
+++ b/yardstick/benchmark/scenarios/storage/fio_benchmark.bash
@@ -15,7 +15,6 @@ set -e
FIO_FILENAME=$1
shift
OPTIONS="$@"
-OUTPUT_FILE="yardstick-fio.log"
# setup data file for fio
setup()
@@ -25,43 +24,10 @@ setup()
fi
}
-# run fio test
+# run fio test and write json format result to stdout
run_test()
{
- fio $OPTIONS --output=$OUTPUT_FILE
-}
-
-# write the result to stdout in json format
-output_json()
-{
- read_bw=$(grep "READ.*aggrb" $OUTPUT_FILE | awk -F [=\ ,] '{printf $9}')
- write_bw=$(grep "WRITE.*aggrb" $OUTPUT_FILE | awk -F [=\ ,] '{printf $8}')
- eval $(grep -e '\ lat.*stdev' -e "read.*iops" -e "write.*iops" -e "trim.*iops" $OUTPUT_FILE | sed 'N;s/\n/ /g' | grep read | awk -F [=\ ,\(\)] '{printf("read_iops=%s; read_lat_unit=%s; read_lat=%s", $12, $24, $33)}')
- eval $(grep -e '\ lat.*stdev' -e "read.*iops" -e "write.*iops" -e "trim.*iops" $OUTPUT_FILE | sed 'N;s/\n/ /g' | grep write | awk -F [=\ ,\(\)] '{printf("write_iops=%s; write_lat_unit=%s; write_lat=%s", $11, $23, $32)}')
-
- read_bw=${read_bw:-N/A}
- write_bw=${write_bw:-N/A}
- read_iops=${read_iops:-N/A}
- write_iops=${write_iops:-N/A}
- if [ "x$read_lat" = "x" ]; then
- read_lat="N/A"
- else
- read_lat=$read_lat$read_lat_unit
- fi
- if [ "x$write_lat" = "x" ]; then
- write_lat="N/A"
- else
- write_lat=$write_lat$write_lat_unit
- fi
-
- echo -e "{ \
- \"read_bw\":\"$read_bw\", \
- \"write_bw\":\"$write_bw\", \
- \"read_iops\":\"$read_iops\", \
- \"write_iops\":\"$write_iops\", \
- \"read_lat\":\"$read_lat\", \
- \"write_lat\":\"$write_lat\" \
- }"
+ fio $OPTIONS
}
# main entry
@@ -71,10 +37,7 @@ main()
setup
# run the test
- run_test >/dev/null
-
- # output result
- output_json
+ run_test
}
main