Skip to contentSkip to conversation

fio: reset more counters when ramp time has elapsed

PATCH Superseded [email protected] 1 participant 1 message Oct 18, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fio: reset more counters when ramp time has elapsed

From: Vincent Fu <[email protected]>

Currently,

fio --name=test --ramp_time=2 --time_based=1 --runtime=2s --size=1M

will produce an output line like

IO depths : 1=184.7%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%

184.7% appears because the denominator used in the IO depth calculation is reset at the conclusion of ramp_time but the numerator is not. Latency and other IO depth statistics also include data from IOs completed during ramp time. This patch resets these counters when ramp time is over.

---
 libfio.c | 1 +
 1 file changed, 1 insertion(+)
libfio.c +1 -0
index 674bc1dc..7490a4c9 100644
@@ -133,6 +133,7 @@ void reset_all_stats(struct thread_data *td)
 	int i;
 
 	reset_io_counters(td, 1);
+	reset_io_stats(td);
 
 	for (i = 0; i < DDIR_RWDIR_CNT; i++) {
 		td->io_bytes[i] = 0;
Signature · 1 line
2.17.1