Skip to content

Commit

Permalink
Merge 67c0c42 into d4fd9fe
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho committed Jan 21, 2022
2 parents d4fd9fe + 67c0c42 commit 3d18fda
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 296 deletions.
14 changes: 7 additions & 7 deletions src/Products/ZCatalog/dtml/catalogPlan.dtml
Expand Up @@ -3,14 +3,14 @@

<main class="container-fluid">

<p class="form-help">
The <strong>query plan</strong> shows the actual query plan of the
current process.
</p>
<p class="form-help">
The <strong>query plan</strong> shows the actual query plan of the
current process.
</p>

<textarea name="queryplan" cols="70" rows="25" readonly="readonly">
&dtml-getCatalogPlan;
</textarea>
<textarea name="queryplan" cols="70" rows="25" readonly="readonly"
class="form-control text-monospace code">&dtml-getCatalogPlan;
</textarea>

</main>

Expand Down
193 changes: 79 additions & 114 deletions src/Products/ZCatalog/dtml/catalogReport.dtml
Expand Up @@ -3,122 +3,87 @@

<main class="container-fluid">

<p class="form-help">
The <strong>query report</strong> shows catalog queries that perform slowly.
For each index there's an additional entry for the time the intersection of
the index result with the result by the other indexes took. These are marked
with a <i>#intersection</i> postfix. The time reported for the index is the
sum of the intersection time and the time the index itself took. Subtract
the intersection time, if you want to know the pure index time.
</p>
<p class="form-help">
The <strong>query report</strong> shows catalog queries that perform slowly.
For each index there's an additional entry for the time the intersection of
the index result with the result by the other indexes took. These are marked
with a <i>#intersection</i> postfix. The time reported for the index is the
sum of the intersection time and the time the index itself took. Subtract
the intersection time, if you want to know the pure index time.
</p>

<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr class="list-header" >
<td align="left" valign="top">
<div class="list-nav">
Mean duration&nbsp;[ms]
</div>
</td>
<td align="left" valign="top">
<div class="list-nav">
Hits
</div>
</td>
<td align="left" valign="top">
<div class="list-nav">
Query key
</div>
</td>
<td align="left" valign="top">
<div class="list-nav">
Recent
</div>
</td>
</tr>
<dtml-if getCatalogReport>
<dtml-in getCatalogReport mapping>
<dtml-if sequence-odd>
<tr class="row-normal">
<dtml-else>
<tr class="row-hilite">
</dtml-if>
<td align="left" valign="top">
<div class="list-item">
<dtml-var expr="'%3.2f' % duration">
</div>
</td>
<td align="left" valign="top">
<div class="list-item">
&dtml-counter;
</div>
</td>
<td align="left" valign="top">
<div class="list-item">
&dtml-query;
</div>
</td>
<td align="left" valign="top">
<div class="list-item">
<dtml-var expr="'%3.2f' % last['duration']">ms
[<dtml-in expr="last['details']" sort mapping>
&dtml-id;:
<dtml-var expr="'%3.2f' % duration">ms,
</dtml-in>]
</div>
</td>
</tr>
</dtml-in>
<tr>
<td colspan="2" align="left" valign="top">
<p class="form-help">Resetting the catalog report will reinitialize the report log.</p>
</td>
<td colspan="2" align="right" valign="top">
<form action="manage_resetCatalogReport" method=POST>
<div class="form-element">
<input class="form-element" type="submit" value="Reset Report">
</div>
</form>
</td>
</tr>
<dtml-else>
<tr>
<td colspan="4" >
<div class="list-item">
Report is empty.
</div>
</td>
</tr>
</dtml-if>
</table>
<table class="table table-sm table-striped table-bordered table-hover">
<thead class="thead-light">
<tr>
<th scope="col">Mean duration&nbsp;[ms]</th>
<th scope="col">Hits</th>
<th scope="col">Query key</th>
<th scope="col">Recent</th>
</tr>
</thead>
<tbody>
<dtml-if getCatalogReport>
<dtml-in getCatalogReport mapping>
<tr>
<td>
<dtml-var expr="'%3.2f' % duration">
</td>
<td>
&dtml-counter;
</td>
<td>
&dtml-query;
</td>
<td>
<dtml-var expr="'%3.2f' % last['duration']">ms
[<dtml-in expr="last['details']" sort mapping>
&dtml-id;: <dtml-var expr="'%3.2f' % duration">ms,
</dtml-in>]
</td>
</tr>
</dtml-in>
<tr>
<td colspan="2">
Resetting the catalog report will reinitialize the report log.
</td>
<td colspan="2">
<form action="manage_resetCatalogReport" method="POST">
<input class="btn btn-primary" type="submit" value="Reset Report">
</form>
</td>
</tr>
<dtml-else>
<tr>
<td colspan="4" >
<em>Report is empty.</em>
</td>
</tr>
</dtml-if>
</tbody>
</table>

<form action="manage_editCatalogReport" method="post">
<table width="100%" style="padding-top:1em;" cellspacing="0" cellpadding="2" border="0">
<tr class="section-bar">
<td colspan="3" align="left">
<div class="form-label">
Settings
</div>
</td>
</tr>
<tr>
<td align="right" valign="middle">
<div class="list-item">
Threshold (in seconds)
</div>
</td>
<td align="left" valign="middle">
<div class="form-element">
<input name="long_query_time:float" value="&dtml-long_query_time;" />
</div>
</td>
<td align="left" valign="middle">
<p class="form-help">Only queries whose execution
takes longer than the configured threshold are considered
being slow. (Default 0.1 seconds).</p>
</tr>
</table>
<input class="form-element" type="submit" value="Apply settings">
</form>
<form action="manage_editCatalogReport" method="post" class="mt-5">
<p class="help-text">
<strong>Settings:</strong>
Threshold in seconds
</p>
<div class="form-group row">
<div class="col-12">
<input id="long_query_time" class="form-control" name="long_query_time:float"
title="Threshold in seconds" type="number" step="0.1"
value="&dtml-long_query_time;" placeholder="0.1"
/>
<small><em>
Only queries whose execution takes longer than the
configured threshold in seconds are considered
being slow. (Default value is 0.1 seconds).
</em></small>
</div>
</div>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" value="Apply settings" />
</div>
</form>

</main>

Expand Down

0 comments on commit 3d18fda

Please sign in to comment.