mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
virtio-devices: block: Correct the latency for the first op
There is a "LATENCY_SCALE" being used for calculating cumulative average latency, so it should also be used for the latency of the first op. See: #5712 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
07d1208dd5
commit
e2db476f6e
@ -307,7 +307,7 @@ impl BlockEpollHandler {
|
||||
|
||||
// Special case the first real latency report
|
||||
read_avg = if read_avg == u64::MAX {
|
||||
latency
|
||||
latency * LATENCY_SCALE
|
||||
} else {
|
||||
read_avg
|
||||
+ ((latency * LATENCY_SCALE) - read_avg)
|
||||
@ -337,7 +337,7 @@ impl BlockEpollHandler {
|
||||
|
||||
// Special case the first real latency report
|
||||
write_avg = if write_avg == u64::MAX {
|
||||
latency
|
||||
latency * LATENCY_SCALE
|
||||
} else {
|
||||
write_avg
|
||||
+ ((latency * LATENCY_SCALE) - write_avg)
|
||||
|
Loading…
Reference in New Issue
Block a user