Commit f8a067e8 authored by Zixian Cai's avatar Zixian Cai

Make commit label clickable

parent 9428a3bb
...@@ -31,6 +31,7 @@ FAIL_EARLY = True ...@@ -31,6 +31,7 @@ FAIL_EARLY = True
WEB_POI_REPO = "mu-impl-fast" WEB_POI_REPO = "mu-impl-fast"
WEB_POI_HOST = "angus" WEB_POI_HOST = "angus"
WEB_POI_COMMIT_FORMATTER = lambda x: x
WEB_RESULT_DIR = "../results" WEB_RESULT_DIR = "../results"
WEB_SECRET = os.urandom(24) WEB_SECRET = os.urandom(24)
WEB_PREFIX = "" WEB_PREFIX = ""
......
...@@ -31,6 +31,8 @@ root = Blueprint('root', __name__, ...@@ -31,6 +31,8 @@ root = Blueprint('root', __name__,
@root.route("/visualize_commit", methods=["POST"]) @root.route("/visualize_commit", methods=["POST"])
def visualize_commit(): def visualize_commit():
repo, host = settings.WEB_POI_REPO, settings.WEB_POI_HOST repo, host = settings.WEB_POI_REPO, settings.WEB_POI_HOST
assert (request.form.get("commit") and
request.form.get("commit")[:7].isalnum())
result = storage.load(repo, host, request.form.get("commit")[:7]) result = storage.load(repo, host, request.form.get("commit")[:7])
group_stats_result(result) group_stats_result(result)
return render_template("visualize.html", result=result) return render_template("visualize.html", result=result)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from mubench.frontend.utils import group_stats_result from mubench.frontend.utils import group_stats_result
from collections import defaultdict from collections import defaultdict
from mubench.conf import settings
def extract(op): def extract(op):
tasksets = op["ts"] tasksets = op["ts"]
...@@ -29,7 +29,7 @@ def make_timeline(ops): ...@@ -29,7 +29,7 @@ def make_timeline(ops):
for op in ops: for op in ops:
group_stats_result(op) group_stats_result(op)
extracts = [extract(x) for x in ops] extracts = [extract(x) for x in ops]
revisions = [op["revision"] for op in ops] revisions = [settings.WEB_POI_COMMIT_FORMATTER(op["revision"]) for op in ops]
timestamp = [op["timestamp"] for op in ops] timestamp = [op["timestamp"] for op in ops]
results = defaultdict(dict) results = defaultdict(dict)
for (idx, x) in enumerate(extracts): for (idx, x) in enumerate(extracts):
......
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