%@ page import="com.atlassian.jira.ofbiz.PerformanceSQLInterceptor" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page import="com.atlassian.jira.web.filters.accesslog.AccessLogImprinter" %>
<%@ page import="com.atlassian.jira.config.properties.JiraSystemProperties" %>
<%@ page import="com.opensymphony.util.TextUtils" %>
<%@ page import="com.atlassian.jira.util.lang.Pair" %>
<%
if(session != null && JiraSystemProperties.showPerformanceMonitor())
{
final Map storage =
(Map) session.getAttribute(AccessLogImprinter.REQUEST_SQL_CACHE_STORAGE);
final PerformanceSQLInterceptor.SQLPerfCache cache = storage.get(request.getParameter("requestId"));
if(cache != null)
{
%>
Invocations
| SQL | # | Avg (ms) | Total (ms) |
<%
final Map> statements = cache.getStatements();
long overallTotal = 0;
long overallTotalInvocations = 0;
int count =0;
for (Map.Entry> entry : statements.entrySet())
{
final List value = entry.getValue();
long totalTime = 0;
for (int i = 0; i < value.size(); i++)
{
final Long timing = value.get(i);
totalTime += timing;
}
overallTotal += totalTime;
overallTotalInvocations += value.size();
final long avg = totalTime / value.size();
%>
>| <%=TextUtils.htmlEncode(entry.getKey())%> | <%=value.size()%> | <%=avg%> | <%=totalTime%> |
<%
count++;
}
%>
| <%=overallTotalInvocations%> | | <%=overallTotal%> |
Statements in Execution Order
<%
final List> statementsInCallOrder = cache.getStatementsInCallOrder();
count = 0;
for (Pair statement : statementsInCallOrder)
{
%>
- >
<%=TextUtils.htmlEncode(statement.first())%>
<%=TextUtils.br(TextUtils.htmlEncode(statement.second()))%>
<%
count++;
}
%>
<% }
} %>