visualize.html 3.44 KB
Newer Older
Zixian Cai's avatar
Zixian Cai committed
1
{% extends 'base.html' %}
Zixian Cai's avatar
Zixian Cai committed
2
{% from "marcos.html" import responsive_header,responsive_footer %}
Zixian Cai's avatar
Zixian Cai committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
{% block body %}
    <div class="panel panel-info">
        <div class="panel-heading">Platform information</div>
        <div class="panel-body">
            <ul>
                <li>CPU: {{ result["cpu"] }}</li>
                <li>uname: {{ result["uname"] }}</li>
                <li>Hostname: {{ result["hostname"] }}</li>
            </ul>
        </div>
    </div>
    {% for ts in result["ts"] %}
        <div class="panel panel-primary">
            <div class="panel-heading">TaskSet {{ ts["name"] }}</div>
            <div class="panel-body">
                <ul>
                    <li>Iteration: {{ ts["iterations"] }}</li>
                    <li>Benchmark: {{ ts["benchmark"]["name"] }}
                        <code>{{ ts["benchmark"]["args"] }}</code>
                    </li>
                    <li>Callback: {{ ts["callback"]["name"] }}
                        <code>{{ ts["callback"]["param"] }}</code>
                    </li>
                </ul>
27 28
                <div id="barplot_ts_{{ ts["name"] }}"></div>
                <div id="boxplot_ts_{{ ts["name"] }}"></div>
Zixian Cai's avatar
Zixian Cai committed
29 30 31
            </div>
        </div>
        <script>
32 33 34 35 36 37
            {{ responsive_header("barplot_ts_"+ts["name"]) }}
            var data = [];
            {% for metric in ts["metrics"] %}
                var temp_x = [];
                var temp_y = [];
                var temp_yerr = [];
Zixian Cai's avatar
Zixian Cai committed
38

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
                {% 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>
        <script>
            {{ responsive_header("boxplot_ts_"+ts["name"]) }}
            var data = [];
            {% for metric in ts["metrics"] %}
                var temp_x = [];
                var temp_y = [];
                {% for task in ts["datapoints_grouped"] %}
                    var rawArr = {{ ts["datapoints_grouped"][task][metric].raw }};
                    rawArr.forEach(
                        function (val) {
                            temp_x.push("{{ task }}");
                            temp_y.push(val);
                        }
                    );
Zixian Cai's avatar
Zixian Cai committed
75
                {% endfor %}
76 77 78 79 80
                var trace_{{ metric }} = {
                    x: temp_x,
                    y: temp_y,
                    name: '{{ metric }}',
                    type: 'box'
Zixian Cai's avatar
Zixian Cai committed
81
                };
82 83 84 85 86 87 88
                data.push(trace_{{ metric }});
            {% endfor %}
            var layout = {
                boxmode: 'group'
            };
            Plotly.newPlot('boxplot_ts_{{ ts["name"] }}', data, layout);
            {{ responsive_footer() }}
Zixian Cai's avatar
Zixian Cai committed
89 90 91
        </script>
    {% endfor %}
{% endblock %}