SLING-11102 - Improving reporting for query performance
diff --git a/core/src/main/java/org/apache/sling/cms/core/models/QueryDebugger.java b/core/src/main/java/org/apache/sling/cms/core/models/QueryDebugger.java
index 6565d51..5af640e 100644
--- a/core/src/main/java/org/apache/sling/cms/core/models/QueryDebugger.java
+++ b/core/src/main/java/org/apache/sling/cms/core/models/QueryDebugger.java
@@ -55,7 +55,7 @@
@Model(adaptables = SlingHttpServletRequest.class)
public class QueryDebugger {
- private static final String MBEAN_NAME = "org.apache.jackrabbit.oak:name=Oak Query Statistics,type=QueryStat";
+ private static final String MBEAN_NAME = "org.apache.jackrabbit.oak:name=Oak Query Statistics (Extended),type=QueryStats";
private static final Logger log = LoggerFactory.getLogger(QueryDebugger.class);
private final String plan;
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/querydebug/querydebug.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/querydebug/querydebug.jsp
index 8bd1f38..14e4612 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/querydebug/querydebug.jsp
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/querydebug/querydebug.jsp
@@ -52,81 +52,122 @@
</dl>
<br/><hr/><br/>
<h2><fmt:message key="Popular Queries" /></h2>
- <table class="table">
- <tr>
- <th scope="col">
- #
- </th>
- <th scope="col">
- <fmt:message key="Query Statement" />
- </th>
- <th scope="col">
- <fmt:message key="Query Language" />
- </th>
- <th scope="col">
- <fmt:message key="Count" />
- </th>
- <th scope="col">
- <fmt:message key="Duration" />
- </th>
- </tr>
- <c:forEach var="query" items="${queryDebugger.popularQueries}">
+ <div class="table-container">
+ <table class="table">
<tr>
- <td>
- ${query.position}
- </td>
- <td>
- ${sling:encode(query.statement,'HTML')}
- </td>
- <td>
- ${query.language}
- </td>
- <td>
- ${query.occurrenceCount}
- </td>
- <td>
- ${query.duration}
- </td>
+ <th scope="col">
+ #
+ </th>
+ <th scope="col">
+ <fmt:message key="Query Statement" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Query Language" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Count" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Last Thread" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Duration" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Max Rows Scanned" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Rows Scanned / Read" />
+ </th>
</tr>
- </c:forEach>
- </table>
+ <c:forEach var="query" items="${queryDebugger.popularQueries}">
+ <tr>
+ <td>
+ ${query.position}
+ </td>
+ <td>
+ ${sling:encode(query.statement,'HTML')}
+ </td>
+ <td>
+ ${query.language}
+ </td>
+ <td>
+ ${query.executeCount}
+ </td>
+ <td>
+ ${sling:encode(query.lastThread,'HTML')}
+ </td>
+ <td>
+ ${query.totalTimeMillis}
+ </td>
+ <td>
+ ${query.maxRowsScanned}
+ </td>
+ <td>
+ ${query.rowsScanned} / ${query.rowsRead}
+ </td>
+ </tr>
+ </c:forEach>
+ </table>
+ </div>
<h2><fmt:message key="Slow Queries" /></h2>
- <table class="table">
- <tr>
- <th scope="col">
- #
- </th>
- <th scope="col">
- <fmt:message key="Query Statement" />
- </th>
- <th scope="col">
- <fmt:message key="Query Language" />
- </th>
- <th scope="col">
- <fmt:message key="Count" />
- </th>
- <th scope="col">
- <fmt:message key="Duration" />
- </th>
- </tr>
- <c:forEach var="query" items="${queryDebugger.slowQueries}">
+ <div class="table-container">
+ <table class="table">
<tr>
- <td>
- ${query.position}
- </td>
- <td>
- ${sling:encode(query.statement,'HTML')}
- </td>
- <td>
- ${query.language}
- </td>
- <td>
- ${query.occurrenceCount}
- </td>
- <td>
- ${query.duration}
- </td>
+ <th scope="col">
+ #
+ </th>
+ <th scope="col">
+ <fmt:message key="Query Statement" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Query Language" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Count" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Last Thread" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Duration" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Max Rows Scanned" />
+ </th>
+ <th scope="col">
+ <fmt:message key="Rows Scanned / Read" />
+ </th>
</tr>
- </c:forEach>
- </table>
+ <c:forEach var="query" items="${queryDebugger.slowQueries}">
+ <tr>
+ <td>
+ ${query.position}
+ </td>
+ <td>
+ ${sling:encode(query.statement,'HTML')}
+ </td>
+ <td>
+ ${query.language}
+ </td>
+ <td>
+ ${query.executeCount}
+ </td>
+ <td>
+ ${sling:encode(query.lastThread,'HTML')}
+ </td>
+ <td>
+ ${query.totalTimeMillis}
+ </td>
+ <td>
+ ${query.maxRowsScanned}
+ </td>
+ <td>
+ ${query.rowsScanned} / ${query.rowsRead}
+ </td>
+ </tr>
+ </c:forEach>
+ </table>
+ </div>
+ <br/><br/><br/>
</div>
\ No newline at end of file