y_sorted = OrderedDict()
y_tags_l = {s: [t.lower() for t in ts] for s, ts in y_tags.items()}
for tag in order:
- logging.info(tag)
+ logging.debug(tag)
for suite, tags in y_tags_l.items():
if "not " in tag:
tag = tag.split(" ")[-1]
try:
y_sorted[suite] = y_vals.pop(suite)
y_tags_l.pop(suite)
- logging.info(suite)
+ logging.debug(suite)
except KeyError as err:
- logging.error("Not found: {0}".format(err))
+ logging.error("Not found: {0}".format(repr(err)))
finally:
break
else:
for i, col in enumerate(df.columns):
name = "{0}. {1}".format(i + 1, col.lower().replace('-ndrpdrdisc', '').
replace('-ndrpdr', ''))
- logging.info(name)
+ logging.debug(name)
traces.append(plgo.Box(x=[str(i + 1) + '.'] * len(df[col]),
y=[y / 1000000 if y else None for y in df[col]],
name=name,
**plot["traces"]))
- val_max = max(df[col])
+ try:
+ val_max = max(df[col])
+ except ValueError as err:
+ logging.error(repr(err))
+ continue
if val_max:
y_max.append(int(val_max / 1000000) + 1)
plot["output-file-type"]))
except PlotlyError as err:
logging.error(" Finished with error: {}".
- format(str(err).replace("\n", " ")))
+ format(repr(err).replace("\n", " ")))
return
for job in data:
for build in job:
for test in build:
+ try:
+ logging.debug("test['latency']: {0}\n".
+ format(test["latency"]))
+ except ValueError as err:
+ logging.warning(repr(err))
if y_tmp_vals.get(test["parent"], None) is None:
y_tmp_vals[test["parent"]] = [
list(), # direction1, min
elif "-ndr" in plot_title.lower():
ttype = "NDR"
else:
+ logging.warning("Invalid test type: {0}".
+ format(test["type"]))
continue
y_tmp_vals[test["parent"]][0].append(
test["latency"][ttype]["direction1"]["min"])
y_tmp_vals[test["parent"]][5].append(
test["latency"][ttype]["direction2"]["max"])
else:
+ logging.warning("Invalid test type: {0}".
+ format(test["type"]))
continue
- except (KeyError, TypeError):
- pass
-
+ except (KeyError, TypeError) as err:
+ logging.warning(repr(err))
+ logging.debug("y_tmp_vals: {0}\n".format(y_tmp_vals))
# 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:
+ logging.debug(tag)
for suite, tags in y_tags_l.items():
- if tag.lower() in tags:
- try:
- y_sorted[suite] = y_tmp_vals.pop(suite)
- y_tags_l.pop(suite)
- except KeyError as err:
- logging.error("Not found: {0}".format(err))
- finally:
- break
+ if "not " in tag:
+ tag = tag.split(" ")[-1]
+ if tag.lower() in tags:
+ continue
+ else:
+ if tag.lower() not in tags:
+ continue
+ try:
+ y_sorted[suite] = y_tmp_vals.pop(suite)
+ y_tags_l.pop(suite)
+ logging.debug(suite)
+ except KeyError as err:
+ logging.error("Not found: {0}".format(repr(err)))
+ finally:
+ break
else:
y_sorted = y_tmp_vals
+ logging.debug("y_sorted: {0}\n".format(y_sorted))
x_vals = list()
y_vals = list()
y_mins = list()
y_mins.append(mean(val[3]) if val[3] else None)
y_maxs.append(mean(val[5]) if val[5] else None)
+ logging.debug("x_vals :{0}\n".format(x_vals))
+ logging.debug("y_vals :{0}\n".format(y_vals))
+ logging.debug("y_mins :{0}\n".format(y_mins))
+ logging.debug("y_maxs :{0}\n".format(y_maxs))
traces = list()
annotations = list()
arrayminus = [y_vals[idx] - y_mins[idx], ]
else:
arrayminus = [None, ]
+ logging.debug("y_vals[{1}] :{0}\n".format(y_vals[idx], idx))
+ logging.debug("array :{0}\n".format(array))
+ logging.debug("arrayminus :{0}\n".format(arrayminus))
traces.append(plgo.Scatter(
x=[idx, ],
y=[y_vals[idx], ],
for test_name, test_vals in y_vals.items():
for key, test_val in test_vals.items():
if test_val:
- y_vals[test_name][key] = sum(test_val) / len(test_val)
- if key == "1":
- y_1c_max[test_name] = max(test_val) / 1000000.0
+ avg_val = sum(test_val) / len(test_val)
+ y_vals[test_name][key] = avg_val
+ ideal = avg_val / (int(key) * 1000000.0)
+ if test_name not in y_1c_max or ideal > y_1c_max[test_name]:
+ y_1c_max[test_name] = ideal
vals = dict()
y_max = list()
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"]))
+ try:
+ val_max = max(max(vals[name]["val"], vals[name]["ideal"]))
+ except ValueError as err:
+ logging.error(err)
+ continue
if val_max:
y_max.append(int((val_max / 10) + 1) * 10)
x_vals = [1, 2, 4]
# Limits:
- threshold = 1.1 * max(y_max) # 10%
-
+ try:
+ threshold = 1.1 * max(y_max) # 10%
+ except ValueError as err:
+ logging.error(err)
+ return
nic_limit /= 1000000.0
if nic_limit < threshold:
traces.append(plgo.Scatter(