test/bdev: Calculate accurate time interval to verify QoS limit

By using two ticks values and tick_rate, we can get more accurate
time interval to verify QoS limit.  This may get rid of our
anxiety about latency of sleep command and RPC calls.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic7deee8e778fbd653f01e8426640a96245cee437
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475168
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-11-20 07:56:01 +09:00 committed by Tomasz Zawadzki
parent ed2a638e89
commit 91cc56ac15

View File

@ -63,6 +63,8 @@ function get_io_result() {
else
io_result_before=$(echo $io_result | jq -r '.bdevs[0].bytes_read')
fi
tick_rate=$(echo $io_result | jq -r '.tick_rate')
ticks_before=$(echo $io_result | jq -r '.ticks')
sleep $QOS_RUN_TIME
@ -72,8 +74,9 @@ function get_io_result() {
else
io_result_after=$(echo $io_result | jq -r '.bdevs[0].bytes_read')
fi
ticks_after=$(echo $io_result | jq -r '.ticks')
echo $(((io_result_after-io_result_before)/QOS_RUN_TIME))
echo $((((io_result_after-io_result_before)*tick_rate)/(ticks_after-ticks_before)))
}
function run_qos_test() {