+ name = "-".join(test_name.split('-')[1:-1])
+
+ vals[name] = dict()
+ y_val_1 = test_vals["1"] / 1000000.0
+ y_val_2 = test_vals["2"] / 1000000.0 if test_vals["2"] else None
+ y_val_4 = test_vals["4"] / 1000000.0 if test_vals["4"] else None
+
+ vals[name]["val"] = [y_val_1, y_val_2, y_val_4]
+ vals[name]["rel"] = [1.0, None, None]
+ vals[name]["ideal"] = [y_1c_max[test_name],
+ y_1c_max[test_name] * 2,
+ y_1c_max[test_name] * 4]
+ vals[name]["diff"] = \
+ [(y_val_1 - y_1c_max[test_name]) * 100 / y_val_1, None, None]
+
+ val_max = max(max(vals[name]["val"], vals[name]["ideal"]))
+ if val_max:
+ y_max.append(int((val_max / 10) + 1) * 10)
+
+ if y_val_2:
+ vals[name]["rel"][1] = round(y_val_2 / y_val_1, 2)
+ vals[name]["diff"][1] = \
+ (y_val_2 - vals[name]["ideal"][1]) * 100 / y_val_2
+ if y_val_4:
+ vals[name]["rel"][2] = round(y_val_4 / y_val_1, 2)
+ vals[name]["diff"][2] = \
+ (y_val_4 - vals[name]["ideal"][2]) * 100 / y_val_4
+
+ # Limits:
+ if "x520" in test_name:
+ limit = plot["limits"]["nic"]["x520"]
+ elif "x710" in test_name:
+ limit = plot["limits"]["nic"]["x710"]
+ elif "xxv710" in test_name:
+ limit = plot["limits"]["nic"]["xxv710"]
+ elif "xl710" in test_name:
+ limit = plot["limits"]["nic"]["xl710"]
+ else:
+ limit = 0
+ if limit > nic_limit:
+ nic_limit = limit
+
+ mul = 2 if "ge2p" in test_name else 1
+ if "10ge" in test_name:
+ limit = plot["limits"]["link"]["10ge"] * mul
+ elif "25ge" in test_name:
+ limit = plot["limits"]["link"]["25ge"] * mul
+ elif "40ge" in test_name:
+ limit = plot["limits"]["link"]["40ge"] * mul
+ elif "100ge" in test_name:
+ limit = plot["limits"]["link"]["100ge"] * mul
+ else:
+ limit = 0
+ if limit > lnk_limit:
+ lnk_limit = limit
+
+ # Sort the tests
+ order = plot.get("sort", None)
+ if order and y_tags:
+ y_sorted = OrderedDict()
+ y_tags_l = {s: [t.lower() for t in ts] for s, ts in y_tags.items()}
+ for tag in order:
+ for test, tags in y_tags_l.items():
+ if tag.lower() in tags:
+ name = "-".join(test.split('-')[1:-1])
+ try:
+ y_sorted[name] = vals.pop(name)
+ y_tags_l.pop(test)
+ except KeyError as err:
+ logging.error("Not found: {0}".format(err))
+ finally:
+ break
+ else:
+ y_sorted = vals
+