+ raw_data = jsonutils.loads(stdout)
+
+ # The bandwidth unit is KB/s, and latency unit is us
+ if rw in ["read", "randread", "rw", "randrw"]:
+ result["read_bw"] = raw_data["jobs"][0]["read"]["bw"]
+ result["read_iops"] = raw_data["jobs"][0]["read"]["iops"]
+ result["read_lat"] = raw_data["jobs"][0]["read"]["lat"]["mean"]
+ if rw in ["write", "randwrite", "rw", "randrw"]:
+ result["write_bw"] = raw_data["jobs"][0]["write"]["bw"]
+ result["write_iops"] = raw_data["jobs"][0]["write"]["iops"]
+ result["write_lat"] = raw_data["jobs"][0]["write"]["lat"]["mean"]
+
+ if "sla" in self.scenario_cfg:
+ sla_error = ""
+ for k, v in result.items():
+ if k not in self.scenario_cfg['sla']:
+ continue
+
+ if "lat" in k:
+ # For lattency small value is better
+ max_v = float(self.scenario_cfg['sla'][k])
+ 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(self.scenario_cfg['sla'][k])
+ if v < min_v:
+ sla_error += "%s %d < " \
+ "sla:%s(%d); " % (k, v, k, min_v)
+
+ assert sla_error == "", sla_error