Add gauge metrics for Functest reporting dashboard
[releng.git] / utils / test / reporting / functest / template / index-status-tmpl.html
index 604f2c8..96240de 100644 (file)
@@ -21,7 +21,7 @@
         <h3 class="text-muted">Functest status page ({{version}})</h3>
         <nav>
           <ul class="nav nav-justified">
-            <li class="active"><a href="index.html">Home</a></li>
+            <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
             <li><a href="index-status-apex.html">Apex</a></li>
             <li><a href="index-status-compass.html">Compass</a></li>
             <li><a href="index-status-fuel.html">Fuel</a></li>
             <div class="panel-heading"><h4><b>List of last scenarios ({{version}}) run over the last {{period}} days </b></h4></div>
                 <table class="table">
                     <tr>
-                        <th width="80%">Scenario</th>
-                        <th width="20%">Iteration</th>
+                        <th width="60%">Scenario</th>
+                        <th width="20%">Status</th>
+                        <th width="10%">Score</th>
+                        <th width="10%">Iteration</th>
                     </tr>
                         {% for scenario,iteration in scenario_stats.iteritems() -%}
                             <tr class="tr-ok">
                                 <td>{{scenario}}</td>
+                                <td>{%if scenario_results[scenario].getScorePercent() < 8.3 -%}
+                                        <img src="../../img/gauge_0.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 16.7 -%}
+                                        <img src="../../img/gauge_8.3.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 25 -%}
+                                        <img src="../../img/gauge_16.7.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 33.3 -%}
+                                        <img src="../../img/gauge_25.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 41.7 -%}
+                                        <img src="../../img/gauge_33.3.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 50 -%}
+                                        <img src="../../img/gauge_41.7.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 58.3 -%}
+                                        <img src="../../img/gauge_50.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 66.7 -%}
+                                        <img src="../../img/gauge_58.3.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 75 -%}
+                                        <img src="../../img/gauge_66.7.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 83.3 -%}
+                                        <img src="../../img/gauge_75.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 91.7 -%}
+                                        <img src="../../img/gauge_83.3.png">
+                                    {%elif scenario_results[scenario].getScorePercent() < 100 -%}
+                                        <img src="../../img/gauge_91.7.png">
+                                    {%- else -%}
+                                        <img src="../../img/gauge_100.png">
+                                {%- endif %}</td>
+                                <td>{{scenario_results[scenario].getScore()}}</td>
                                 <td>{{iteration}}</td>
                             </tr>
                             {%- endfor %}
@@ -53,7 +83,6 @@
         </div>
 
 
-
         {% for scenario, iteration in scenario_stats.iteritems() -%}
         <div class="scenario-part">
             <div class="page-header">
                     <table class="table">
                         <tr>
                             {% for test in items[scenario] -%}
-                            <th>{{test.getName() }}</th>
+                            <th>
+                            {% if test.getCriteria() > -1 -%}
+                            {{test.getDisplayName() }}
+                            {%- endif %}
+                            {% if test.getTier() > 3 -%}
+                            *
+                            {%- endif %}
+                             </th>
                             {%- endfor %}
                         </tr>
                         <tr class="tr-weather-weather">
                             {% for test in items[scenario] -%}
-                            {% if test.isRunnable is sameas false -%}
-                                <td>N.R</td>
-                            {% elif test.getCriteria() > 2 -%}
+                            {% if test.getCriteria() > 2 -%}
                                 <td><img src="../../img/weather-clear.png"></td>
                             {%- elif test.getCriteria() > 1 -%}
                                 <td><img src="../../img/weather-few-clouds.png"></td>
                             {%- elif test.getCriteria() > 0 -%}
                                 <td><img src="../../img/weather-overcast.png"></td>
-                            {%- else -%}
+                            {%- elif test.getCriteria() > -1 -%}
                                 <td><img src="../../img/weather-storm.png"></td>
                             {%- endif %}
                             {%- endfor %}
                 </div>
         </div>
         {%- endfor %}
+    see <a href="https://wiki.opnfv.org/pages/viewpage.action?pageId=6828617">Functest scoring wiki page</a> for details on scenario scoring
     </div>
     <div class="col-md-1"></div>
 </div>