fixed Execution Time Statistics report
[proteocache.git] / webapp / view / reports / TimeExecution.jsp
index 2411b12..dbf654c 100644 (file)
@@ -10,6 +10,7 @@
 <body>
        <div class="container">
                <jsp:include page="../fragments/mainmenu.jsp" />
+               <spring:url value="/stat/jobsoneday/executionTime" var="oneday_query" />
                <spring:url value="/stat/exectime/results?date1=${date1}&date2=${date2}&option=${option}" var="the_query" />
 
        <!-- reload and CSV buttons -->
        </div>
        
        <div class="panel-body">
-               <c:set var="sum" value="0" />
-               <c:forEach items="${result}" var="res" varStatus="loop">
-                       <c:choose>
-                               <c:when test="${loop.last}">
-                                       <c:forEach items="${res.timeTotalExec}" var="total">
-                                               <c:set var="sum" value="${sum + total}" />
-                                       </c:forEach>
-                               </c:when>
-                       </c:choose>
-               </c:forEach>
-
-               <p>There are ${sum} jobs in total</p>
-
-               <table class="table table-striped table-hover table-bordered">
-                       <thead>
+               <c:choose>
+                       <c:when test="${result == null}">
+                               <p>No jobs for this period</p>
+                       </c:when>
+               <c:otherwise>
+                       <div class="table-responsive">
+                       <table class="table table-striped table-hover table-bordered">
+                               <thead>
                                <tr>
                                        <th style="text-align: center; width: 150px">Date</th>
                                        <th style="text-align: center; width: 150px">Total</th>
                                </tr>
                        </thead>
                        <tbody>
-                               <c:forEach items="${result}" var="res" varStatus="loop">
-                                       <c:choose>
-                                               <c:when test="${loop.last}">
-                                                       <tr style="font-weight: bolder;">
-                                                               <td style="text-align: right">Total numbers:</td>
-                                                               <c:set var="alldaytotal" value="0"/>
-                                                               <c:forEach items="${res.timeTotalExec}" var="total">
-                                                                       <c:set var="alldaytotal" value="${alldaytotal + total}"/>
-                                                               </c:forEach>
-                                                               <td style="text-align: right">${alldaytotal}</td>
-                                                               <c:forEach items="${res.timeTotalExec}" var="total">
-                                                                       <td style="text-align: right">${total}</td>
-                                                               </c:forEach>
-                                                       </tr>
-                                               </c:when>
-                                       </c:choose>
-                               </c:forEach>
+                               <tr style="font-weight: bolder;">
+                                                       <td style="text-align: center">Total:</td>
+                                                       <c:set var="total" value="${result.wholeTotal}"/>
+                                                       <td style="text-align: right">${total.total}</td>
+                                                       <td style="text-align: right">${total.total0_30s}</td>
+                                                       <td style="text-align: right">${total.total30_60s}</td>
+                                                       <td style="text-align: right">${total.total1_2m}</td>
+                                                       <td style="text-align: right">${total.total2_10m}</td>
+                                                       <td style="text-align: right">${total.total10m}</td>
+                               </tr>
 
-                               <c:forEach items="${result}" var="res" varStatus="loop">
-                                       <c:choose>
-                                               <c:when test="${not loop.last}">
+                               <c:forEach items="${result.dateTotal}" var="res">
                                                        <tr>
-                                                               <td style="text-align: center">${res.date}</td>
-                                                               <c:set var="daytotal" value="0"/>
-                                                               <c:forEach items="${res.timeRez}" var="time">
-                                                                       <c:set var="daytotal" value="${daytotal + time}"/>
-                                                               </c:forEach>
-                                                               <td style="text-align: right">${daytotal}</td>
-                                                               <c:forEach items="${res.timeRez}" var="time">
-                                                                       <td style="text-align: right">${time}</td>
-                                                               </c:forEach>
+                                                               <td style="text-align: center">${res.key}</td>
+                                                               <c:set var="value" value="${res.value}"/>
+                                                               <td style="text-align: right">${value.total}</td>
+                                                               <td style="text-align: right">
+                                                                       <c:choose>
+                                                                               <c:when test="${value.total0_30s == 0}">0</c:when>
+                                                                               <c:otherwise><a href="${oneday_query}?date=${res.key}&interval=ZERO_THIRTY_SEC">${value.total0_30s}</a></c:otherwise>
+                                                                       </c:choose>
+                                                               </td>
+                                                               <td style="text-align: right">
+                                                                       <c:choose>
+                                                                               <c:when test="${value.total0_30s == 0}">0</c:when>
+                                                                               <c:otherwise><a href="${oneday_query}?date=${res.key}&interval=THIRTY_SIXTY_SEC">${value.total30_60s}</a></c:otherwise>
+                                                                       </c:choose>
+                                                               </td>
+                                                               <td style="text-align: right">
+                                                                       <c:choose>
+                                                                               <c:when test="${value.total0_30s == 0}">0</c:when>
+                                                                               <c:otherwise><a href="${oneday_query}?date=${res.key}&interval=ONE_TWO_MIN">${value.total1_2m}</a></c:otherwise>
+                                                                       </c:choose>
+                                                               </td>
+                                                               <td style="text-align: right">
+                                                                       <c:choose>
+                                                                               <c:when test="${value.total0_30s == 0}">0</c:when>
+                                                                               <c:otherwise><a href="${oneday_query}?date=${res.key}&interval=TWO_TEN_MIN">${value.total2_10m}</a></c:otherwise>
+                                                                       </c:choose>
+                                                               </td>
+                                                               <td style="text-align: right">
+                                                                       <c:choose>
+                                                                               <c:when test="${value.total0_30s == 0}">0</c:when>
+                                                                               <c:otherwise><a href="${oneday_query}?date=${res.key}&interval=MORE_THEN_TEN_MIN">${value.total10m}</a></c:otherwise>
+                                                                       </c:choose>
+                                                               </td>
                                                        </tr>
-                                               </c:when>
-                                       </c:choose>
-                               </c:forEach>
+                                               </c:forEach>
                        </tbody>
                </table>
+               </div>
+               </c:otherwise>
+               </c:choose>
        </div>
        </div>