Commit 7d6fcf42 authored by Zixian Cai's avatar Zixian Cai

Prototyping information displayed on index page

parent ae63b0fd
......@@ -52,10 +52,87 @@ fib:
compiler:
flags:
- -DBUILD_FIB_FAST
web:
executable_groups:
- - rpyc_O3
- rpyzebu
- - c_O3
- c_wasm_O3
- mu_fast
\ No newline at end of file
alloc:
iterations: 20
benchmark:
name: micro/alloc
args:
- 10 # scale factor
- 10000
callback:
name: clock
param: "6"
tasks:
rpyc:
language:
name: rpython
backend: c
source: targetalloc.py
rpyzebu:
language:
name: rpython
backend: mu
impl: zebu
source: targetalloc.py
except:
benchmark:
name: micro/except
args:
- 2000
- 1
- 10
iterations: 20
callback:
name: clock
param: "6"
environ:
PYPY_USESSION_DIR: example
tasks:
rpyc_O3:
language:
name: rpython
backend: c
source: targetexcept.py
environ:
PYPY_C_CLANG_OPT_FLAG: -O3
PYPY_USESSION_BASENAME: "${MUBENCH_TASKSET_NAME}_${MUBENCH_TASK_NAME}"
rpyzebu:
language:
name: rpython
backend: mu
impl: zebu
source: targetexcept.py
environ:
PYPY_USESSION_BASENAME: except_rpyzebu
som:
iterations: 20
benchmark:
name: SOM
args:
- -cp
- $RPYSOM/Smalltalk
- $RPYSOM/TestSuite/TestHarness.som
callback:
name: clock
param: "6"
environ:
PYPY_USESSION_DIR: example # controls where PyPy puts usession directory
PYTHONPATH: $RPYSOM/src
tasks:
rpyc_O3:
language:
name: rpython
backend: c
source: targetrpysom.py
environ:
PYPY_C_CLANG_OPT_FLAG: -O3
PYPY_USESSION_BASENAME: som_rpyc_O3
rpyzebu:
language:
name: rpython
backend: mu
impl: zebu
source: targetrpysom.py
environ:
ZEBU_BUILD: "release"
PYPY_USESSION_BASENAME: som_rpyzebu
......@@ -16,7 +16,8 @@
from flask import Flask, render_template, request, flash, redirect, url_for
from mubench.conf import settings
from mubench.frontend.utils import group_stats_result
from mubench.frontend.web import storage, changes
from mubench.frontend.web import changes
from mubench.frontend.web.storage import LocalStorage as storage
import click
import json
......@@ -72,7 +73,8 @@ def index():
result1 = storage.load_relative(repo, host, 1)
return render_template("index.html",
visualzing=result,
changes=result_compare(result, result1))
#changes=result_compare(result, result1)
)
@click.command()
......
......@@ -13,17 +13,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from mubench.models.revision import GitRevision
from mubench.conf import settings
from pathlib import Path
import json
import os
def load(repo, rev, host):
class Storage:
pass
def store(repo, rev, host, text_form):
pass
class LocalStorage(Storage):
STORAGE_PATH = Path(settings.WEB_RESULT_DIR)
@classmethod
def load(cls, repo, host, rev):
dirname = cls.STORAGE_PATH / repo / host
filename = dirname.glob("{}*".format(rev))[0]
with open(filename) as logfile:
return json.load(logfile)
def load_relative(repo, host, num):
pass
@classmethod
def store(cls, repo, host, rev, timestamp, text_form):
dirname = cls.STORAGE_PATH / repo / host
filename = dirname / "{}_{}".format(rev, timestamp)
os.makedirs(os.path.dirname(filename), exist_ok=True)
with open(filename, "w") as logfile:
logfile.write(text_form)
@classmethod
def load_relative(cls, repo, host, num):
dirname = cls.STORAGE_PATH / repo / host
fs = sorted(
[f.stem for f in dirname.iterdir() if not f.stem.startswith(".")],
key=lambda x: int(x.split("_")[1]))
filename = dirname / fs[-(1 + num)]
with open(filename) as logfile:
return json.load(logfile)
{% extends 'base.html' %}
{% include "visualize_marcos.html" %}
{% from "visualize_marcos.html" import responsive_header,responsive_footer %}
{% block body %}
<div class="panel panel-info">
<div class="panel-heading">Platform information</div>
......
......@@ -2,8 +2,8 @@
(function () {
var d3 = Plotly.d3;
var WIDTH_IN_PERCENT_OF_PARENT = 100,
HEIGHT_IN_PERCENT_OF_PARENT = 100;
var WIDTH_IN_PERCENT_OF_PARENT = 100;
var HEIGHT_IN_PERCENT_OF_PARENT = 50;
var gd3 = d3.select('#{{ elementID }}')
.style({
......@@ -11,7 +11,7 @@
'margin-left': (100 - WIDTH_IN_PERCENT_OF_PARENT) / 2 + '%',
height: HEIGHT_IN_PERCENT_OF_PARENT + 'vh',
'margin-top': (100 - HEIGHT_IN_PERCENT_OF_PARENT) / 2 + 'vh'
//'margin-top': (100 - HEIGHT_IN_PERCENT_OF_PARENT) / 2 + 'vh',
});
var gd = gd3.node();
......
{% include "visualize_marcos.html" %}
\ No newline at end of file
{% from "visualize_marcos.html" import responsive_header,responsive_footer %}
{% for ts in visualzing["ts"] %}
<div class="panel panel-primary col-sm-6">
<div class="panel-heading">{{ ts["name"] }}</div>
<div class="panel-body">
<div id="barplot_ts_{{ ts["name"] }}"></div>
</div>
</div>
<script>
{{ responsive_header("barplot_ts_"+ts["name"]) }}
var data = [];
{% for metric in ts["metrics"] %}
var temp_x = [];
var temp_y = [];
var temp_yerr = [];
{% for task in ts["datapoints_grouped"] %}
temp_x.push("{{ task }}");
temp_y.push({{ ts["datapoints_grouped"][task][metric].mean }});
temp_yerr.push({{ ts["datapoints_grouped"][task][metric].std }});
{% endfor %}
var trace_{{ metric }} = {
x: temp_x,
y: temp_y,
name: '{{ metric }}',
error_y: {
type: 'data',
array: temp_yerr,
visible: true
},
type: 'bar'
};
data.push(trace_{{ metric }});
{% endfor %}
var layout = {barmode: 'group'};
Plotly.newPlot('barplot_ts_{{ ts["name"] }}', data, layout);
{{ responsive_footer() }}
</script>
{% endfor %}
\ No newline at end of file
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