visualize.html 4.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
{#
# Copyright 2017 The Australian National University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#}

Zixian Cai's avatar
Zixian Cai committed
17
{% extends 'base.html' %}
Zixian Cai's avatar
Zixian Cai committed
18
{% from "marcos.html" import responsive_header,responsive_footer %}
Zixian Cai's avatar
Zixian Cai committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
{% 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>
43 44
                <div id="barplot_ts_{{ ts["name"] }}"></div>
                <div id="boxplot_ts_{{ ts["name"] }}"></div>
Zixian Cai's avatar
Zixian Cai committed
45 46 47
            </div>
        </div>
        <script>
48 49 50 51 52 53
            {{ 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
54

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
                {% 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
91
                {% endfor %}
92 93 94 95 96
                var trace_{{ metric }} = {
                    x: temp_x,
                    y: temp_y,
                    name: '{{ metric }}',
                    type: 'box'
Zixian Cai's avatar
Zixian Cai committed
97
                };
98 99 100 101 102 103 104
                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
105 106 107
        </script>
    {% endfor %}
{% endblock %}