Merge "Reporting docker deployment improvement"
[releng.git] / utils / test / reporting / storperf / 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             // ***************************************
30             // Create the trend line
31             {% for scenario in scenario_results.keys() -%}
32             // for scenario {{scenario}}
33             // Filter results
34                 var trend{{loop.index}} = data.filter(function(row) {
35                     return row["scenario"]=="{{scenario}}" && row["installer"]=="{{installer}}";
36                 })
37             // Parse the date
38             trend{{loop.index}}.forEach(function(d) {
39                 d.date = parseDate(d.date);
40                 d.score = +d.score
41             });
42             // Draw the trend line
43             var mytrend = trend("#trend_svg{{loop.index}}",trend{{loop.index}})
44             // ****************************************
45             {%- endfor %}
46         });
47         if ( !window.isLoaded ) {
48             window.addEventListener("load", function() {
49             onDocumentReady();
50             }, false);
51         } else {
52             onDocumentReady();
53         }
54     </script>
55     <script type="text/javascript">
56     $(document).ready(function (){
57         $(".btn-more").click(function() {
58             $(this).hide();
59             $(this).parent().find(".panel-default").show();
60         });
61     })
62     </script>
63   </head>
64     <body>
65     <div class="container">
66       <div class="masthead">
67           <h3 class="text-muted">Storperf status page ({{version}}, {{date}})</h3>
68         <nav>
69           <ul class="nav nav-justified">
70             <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
71             <li><a href="status-apex.html">Apex</a></li>
72             <li><a href="status-compass.html">Compass</a></li>
73             <li><a href="status-fuel.html">Fuel</a></li>
74             <li><a href="status-joid.html">Joid</a></li>
75           </ul>
76         </nav>
77       </div>
78 <div class="row">
79     <div class="col-md-1"></div>
80     <div class="col-md-10">
81         <div class="page-header">
82             <h2>{{installer}}</h2>
83         </div>
84
85         <div class="scenario-overview">
86             <div class="panel-heading"><h4><b>List of last scenarios ({{version}}) run over the last {{period}} days </b></h4></div>
87                 <table class="table">
88                     <tr>
89                         <th width="40%">Scenario</th>
90                         <th width="20%">Status</th>
91                         <th width="20%">Trend</th>
92                         <th width="10%">Last 4 Iterations</th>
93                         <th width="10%">Last 10 Days</th>
94                     </tr>
95                         {% for scenario,result in scenario_results.iteritems() -%}
96                             <tr class="tr-ok">
97                                 <td><a href="{{scenario_results[scenario].getLastUrl()}}">{{scenario}}</a></td>
98                                 <td><div id="gaugeScenario{{loop.index}}"></div></td>
99                                 <td><div id="trend_svg{{loop.index}}"></div></td>
100                                 <td>{{scenario_results[scenario].getFourDaysScore()}}</td>
101                                 <td>{{scenario_results[scenario].getTenDaysScore()}}</td>
102                             </tr>
103                         {%- endfor %}
104                 </table>
105         </div>
106
107
108     </div>
109     <div class="col-md-1"></div>
110 </div>