X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=steadystate.c;h=3468428f4ab97c228e9766274a79785820b561a8;hp=696ad164ac2fe159d180a7744d9b4d8a6fd0f323;hb=d685adfb27d3f2f94a6623c774a246bcaac2f853;hpb=e6a6a9844038b1e4dd8f979c37579be695c770d0 diff --git a/steadystate.c b/steadystate.c index 696ad164..3468428f 100644 --- a/steadystate.c +++ b/steadystate.c @@ -38,6 +38,7 @@ void steadystate_setup(void) if (!td->o.group_reporting) { steadystate_alloc(td); + td->ss.state |= __FIO_SS_DATA; continue; } @@ -341,3 +342,25 @@ int td_steadystate_init(struct thread_data *td) return 0; } + +unsigned long long steadystate_bw_mean(struct steadystate_data *ss) +{ + int i; + unsigned long long sum; + + for (i = 0, sum = 0; i < ss->dur; i++) + sum += ss->bw_data[i]; + + return sum / ss->dur; +} + +unsigned long long steadystate_iops_mean(struct steadystate_data *ss) +{ + int i; + unsigned long long sum; + + for (i = 0, sum = 0; i < ss->dur; i++) + sum += ss->iops_data[i]; + + return sum / ss->dur; +}