Merge "Add d3 graph presentation to yardstick reporting"
[releng.git] / utils / test / reporting / yardstick / template / index-status-tmpl.html
1  <html>
2   <head>
3     <meta charset="utf-8">
4     <!-- Bootstrap core CSS -->
5     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
6     <link href="../../../css/default.css" rel="stylesheet">
7     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
8     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
9     <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
10     <script type="text/javascript" src="../../../js/gauge.js"></script>
11     <script type="text/javascript" src="../../../js/trend.js"></script>
12     <script>
13         function onDocumentReady() {
14             // Gauge management
15             {% for scenario in scenario_results.keys() -%}
16             var gaugeScenario{{loop.index}} = gauge('#gaugeScenario{{loop.index}}');
17             {%- endfor %}
18             // assign success rate to the gauge
19             function updateReadings() {
20                 {% for scenario in scenario_results.keys() -%}
21                  gaugeScenario{{loop.index}}.update({{scenario_results[scenario].getScorePercent()}});
22                  {%- endfor %}
23             }
24             updateReadings();
25         }
26
27         // trend line management
28         //d3.csv("./scenario_history.txt", function(data) {
29         d3.csv("./scenario_history.txt", function(data) {
30             // ***************************************
31             // Create the trend line
32             {% for scenario in scenario_results.keys() -%}
33             // for scenario {{scenario}}
34             // Filter results
35                 var trend{{loop.index}} = data.filter(function(row) {
36                     return row["scenario"]=="{{scenario}}" && row["installer"]=="{{installer}}";
37                 })
38             // Parse the date
39             trend{{loop.index}}.forEach(function(d) {
40                 d.date = parseDate(d.date);
41                 d.score = +d.score
42             });
43             // Draw the trend line
44             var mytrend = trend("#trend_svg{{loop.index}}",trend{{loop.index}})
45             // ****************************************
46             {%- endfor %}
47         });
48         if ( !window.isLoaded ) {
49             window.addEventListener("load", function() {
50             onDocumentReady();
51             }, false);
52         } else {
53             onDocumentReady();
54         }
55     </script>
56     <script type="text/javascript">
57     $(document).ready(function (){
58         $(".btn-more").click(function() {
59             $(this).hide();
60             $(this).parent().find(".panel-default").show();
61         });
62     })
63     </script>
64   </head>
65     <body>
66     <div class="container">
67       <div class="masthead">
68           <h3 class="text-muted">Yardstick status page ({{version}}, {{date}})</h3>
69         <nav>
70           <ul class="nav nav-justified">
71             <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
72             <li><a href="index-status-apex.html">Apex</a></li>
73             <li><a href="index-status-compass.html">Compass</a></li>
74             <li><a href="index-status-fuel.html">Fuel</a></li>
75             <li><a href="index-status-joid.html">Joid</a></li>
76           </ul>
77         </nav>
78       </div>
79 <div class="row">
80     <div class="col-md-1"></div>
81     <div class="col-md-10">
82         <div class="page-header">
83             <h2>{{installer}}</h2>
84         </div>
85
86         <div class="scenario-overview">
87             <div class="panel-heading"><h4><b>List of last scenarios ({{version}}) run over the last {{period}} days </b></h4></div>
88                 <table class="table">
89                     <tr>
90                         <th width="40%">Scenario</th>
91                         <th width="20%">Status</th>
92                         <th width="20%">Trend</th>
93                         <th width="10%">Last 4 Iterations</th>
94                         <th width="10%">Last 10 Days</th>
95                     </tr>
96                         {% for scenario,result in scenario_results.iteritems() -%}
97                             <tr class="tr-ok">
98                                 <td>{{scenario}}</td>
99                                 <td><div id="gaugeScenario{{loop.index}}"></div></td>
100                                 <td><div id="trend_svg{{loop.index}}"></div></td>
101                                 <td>{{scenario_results[scenario].getFourDaysScore()}}</td>
102                                 <td>{{scenario_results[scenario].getTenDaysScore()}}</td>
103                             </tr>
104                         {%- endfor %}
105                 </table>
106         </div>
107
108
109     </div>
110     <div class="col-md-1"></div>
111 </div>