Commit 06922a71 authored by Zixian Cai's avatar Zixian Cai

Ratio is now compared with baseline (first commit)

parent 571c48a6
......@@ -26,6 +26,7 @@
{% else %}
var trace = {type: "scatter", visible: 'legendonly'};
{% endif %}
var None = null; // emulate Python None
var n = {{ timeline[keyname]|length }};
var x = {{ timeline_revisions|safe }};
var y = {{ timeline[keyname] }};
......
......@@ -38,16 +38,17 @@ def make_timeline(ops):
for metric in x[ts][impl]:
keyname = "{}/{}/{}".format(ts, impl, metric)
results[keyname][idx] = x[ts][impl][metric].mean
baseline = {}
for k in results:
v = results[k]
collect_dict = [None] * len(extracts)
for k1, v1 in v.items():
collect_dict[k1] = v1
ratio = [1] * len(extracts)
for i in range(1, len(extracts)):
if collect_dict[i - 1] is not None:
ratio[i] = collect_dict[i] / collect_dict[i - 1]
else:
ratio[i - 1] = 1
ratio = [None] * len(extracts)
for i in range(0, len(extracts)):
if collect_dict[i]:
if k not in baseline:
baseline[k] = collect_dict[i]
ratio[i] = collect_dict[i] / baseline[k]
results[k] = ratio
return results, revisions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment