diff options
author | houjingwen <houjingwen@huawei.com> | 2015-10-19 15:37:06 +0800 |
---|---|---|
committer | Hou Jingwen <houjingwen@huawei.com> | 2015-10-22 00:55:25 +0000 |
commit | e4e8688e0633ef22b2ff0ea8ba739313d5299ecc (patch) | |
tree | 0fee27d4e504b36e9eb24530cf85a0d33fd0b463 /yardstick/benchmark/scenarios/storage | |
parent | 9816c5aa786f7ec831c549b8ed4b5e8ef485da64 (diff) |
Update sla check for scenarios
This patch modify the question that SLA check result is not complete.
JIRA: YARDSTICK-172
Change-Id: I10438390baee92caf00dbfcdbdb833823ff8ce31
Signed-off-by: houjingwen <houjingwen@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/storage')
-rw-r--r-- | yardstick/benchmark/scenarios/storage/fio.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/yardstick/benchmark/scenarios/storage/fio.py b/yardstick/benchmark/scenarios/storage/fio.py index 1107a8b2c..af90b0703 100644 --- a/yardstick/benchmark/scenarios/storage/fio.py +++ b/yardstick/benchmark/scenarios/storage/fio.py @@ -71,11 +71,10 @@ class Fio(base.Scenario): self.setup_done = True - def run(self, args): + def run(self, args, result): """execute the benchmark""" default_args = "-ioengine=libaio -direct=1 -group_reporting " \ "-numjobs=1 -time_based --output-format=json" - result = {} if not self.setup_done: self.setup() @@ -124,6 +123,7 @@ class Fio(base.Scenario): result["write_lat"] = raw_data["jobs"][0]["write"]["lat"]["mean"] if "sla" in args: + sla_error = "" for k, v in result.items(): if k not in args['sla']: continue @@ -131,15 +131,16 @@ class Fio(base.Scenario): if "lat" in k: # For lattency small value is better max_v = float(args['sla'][k]) - assert v <= max_v, "%s %f > " \ - "sla:%s(%f)" % (k, v, k, max_v) + if v > max_v: + sla_error += "%s %f > sla:%s(%f); " % (k, v, k, max_v) else: # For bandwidth and iops big value is better min_v = int(args['sla'][k]) - assert v >= min_v, "%s %d < " \ - "sla:%s(%d)" % (k, v, k, min_v) + if v < min_v: + sla_error += "%s %d < " \ + "sla:%s(%d); " % (k, v, k, min_v) - return result + assert sla_error == "", sla_error def _test(): |