fio_gettime(&now, NULL);
if (ss->ramp_time && !ss->ramp_time_over)
- /*
+ /*
* Begin recording data one second after ss->ramp_time
* has elapsed
*/
rate_time = mtime_since(&ss->prev_time, &now);
memcpy(&ss->prev_time, &now, sizeof(now));
- /*
+ /*
* Begin monitoring when job starts but don't actually use
* data in checking stopping criterion until ss->ramp_time is
* over. This ensures that we will have a sane value in
*/
if (ss->ramp_time_over) {
group_bw += 1000 * (td_bytes - ss->prev_bytes) / rate_time;
- group_iops += 1000 * (td_iops - ss->prev_iops) / rate_time;
+ group_iops += 1000 * (td_iops - ss->prev_iops) / rate_time;
++group_ramp_time_over;
}
ss->prev_iops = td_iops;
if (!group_ramp_time_over)
continue;
- dprint(FD_STEADYSTATE, "steadystate_check() thread: %d, groupid: %u, rate_msec: %ld, iops: %lu, bw: %lu, head: %d, tail: %d\n",
+ dprint(FD_STEADYSTATE, "steadystate_check() thread: %d, groupid: %u, rate_msec: %ld, iops: %lu, bw: %lu, head: %d, tail: %d\n",
i, td->groupid, rate_time, group_iops, group_bw, ss->head, ss->tail);
if (ss->evaluate(group_iops, group_bw, td))
ss->deviation = 0.0;
for (i = 0; i < ss->dur; i++)
- {
+ {
diff = (double) (ss->check_iops ? ss->iops_data[i] : ss->bw_data[i]) - mean;
ss->deviation = max(ss->deviation, diff * (diff < 0.0 ? -1.0 : 1.0));
}
#
# test option parsing
#
- parsing = [ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:10", "--ss_ramp=5"],
+ parsing = [ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:10", "--ss_ramp=5"],
'output': "set steady state IOPS threshold to 10.000000" },
- { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:10%", "--ss_ramp=5"],
+ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:10%", "--ss_ramp=5"],
'output': "set steady state threshold to 10.000000%" },
- { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:.1%", "--ss_ramp=5"],
+ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=iops:.1%", "--ss_ramp=5"],
'output': "set steady state threshold to 0.100000%" },
- { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:10%", "--ss_ramp=5"],
+ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:10%", "--ss_ramp=5"],
'output': "set steady state threshold to 10.000000%" },
- { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:.1%", "--ss_ramp=5"],
+ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:.1%", "--ss_ramp=5"],
'output': "set steady state threshold to 0.100000%" },
- { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:12", "--ss_ramp=5"],
+ { 'args': ["--parse-only", "--debug=parse", "--ss_dur=10s", "--ss=bw:12", "--ss_ramp=5"],
'output': "set steady state BW threshold to 12" },
]
for test in parsing:
tf = tempfile.NamedTemporaryFile(delete=False)
tf.close()
- output = subprocess.check_output([args.fio,
- "--output-format=json",
+ output = subprocess.check_output([args.fio,
+ "--output-format=json",
"--output={0}".format(tf.name)] + accum)
with open(tf.name, 'r') as source:
jsondata = json.loads(source.read())
line = 'PASSED ' + line + ' target {0} < limit {1}, data {2}'.format(target, suite[jobnum]['ss_limit'], job['steadystate'])
else:
line = 'FAILED ' + line + ' target {0} < limit {1} but fio reports ss not attained, data: {2}'.format(target, suite[jobnum]['ss_limit'], job['steadystate'])
-
else:
# check runtime, confirm criterion calculation, and confirm that criterion was not met
expected = suite[jobnum]['timeout'] * 1000