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/compute/lmbench.py | |
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/compute/lmbench.py')
-rw-r--r-- | yardstick/benchmark/scenarios/compute/lmbench.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/yardstick/benchmark/scenarios/compute/lmbench.py b/yardstick/benchmark/scenarios/compute/lmbench.py index 367739128..d2558c936 100644 --- a/yardstick/benchmark/scenarios/compute/lmbench.py +++ b/yardstick/benchmark/scenarios/compute/lmbench.py @@ -58,7 +58,7 @@ class Lmbench(base.Scenario): self.setup_done = True - def run(self, args): + def run(self, args, result): """execute the benchmark""" if not self.setup_done: @@ -75,16 +75,17 @@ class Lmbench(base.Scenario): if status: raise RuntimeError(stderr) - data = json.loads(stdout) + result.update(json.loads(stdout)) if "sla" in args: + sla_error = "" sla_max_latency = int(args['sla']['max_latency']) - for result in data: - latency = result['latency'] - assert latency <= sla_max_latency, "latency %f > " \ - "sla:max_latency(%f)" % (latency, sla_max_latency) - - return data + for t_latency in result: + latency = t_latency['latency'] + if latency > sla_max_latency: + sla_error += "latency %f > sla:max_latency(%f); " \ + % (latency, sla_max_latency) + assert sla_error == "", sla_error def _test(): |