[Zope-Checkins] CVS: Zope/lib/python/Products/CallProfiler/dtml - add.dtml:1.1.2.1 aggregateDetail.dtml:1.1.2.1 aggregates.dtml:1.1.2.1 configure.dtml:1.1.2.1 detail.dtml:1.1.2.1 results.dtml:1.1.2.1

Anthony Baxter anthony@interlink.com.au
Fri, 17 May 2002 01:26:55 -0400


Update of /cvs-repository/Zope/lib/python/Products/CallProfiler/dtml
In directory cvs.zope.org:/tmp/cvs-serv26935/CallProfiler/dtml

Added Files:
      Tag: anthony-CallProfiler-branch
	add.dtml aggregateDetail.dtml aggregates.dtml configure.dtml 
	detail.dtml results.dtml 
Log Message:
Initial checkin of CallProfiler branch. This is the internal ekit version.

Added since the 1.4 release:

  profiler_cache_hook - hooks into the ZCache stuff for hit/miss counts
  sorting on the summary page
  Add / replace a profileable module "on the fly"



=== Added File Zope/lib/python/Products/CallProfiler/dtml/add.dtml ===
<dtml-var manage_page_header>

<form action="manage_add">
ID: <input type="text" name="id"><br>
<input type="submit">
</form>

<dtml-var manage_page_footer>


=== Added File Zope/lib/python/Products/CallProfiler/dtml/aggregateDetail.dtml ===
<dtml-var manage_page_header>
<dtml-call "REQUEST.set('management_view', 'Aggregates')">
<dtml-var manage_tabs>


<dtml-if "validTID(tid)">
<p>
<dtml-var colour_key>
<p>
Change the display to:
<dtml-if show_all>
 <dtml-call "REQUEST.set('span', 3)">
 <a href="&dtml-URL0;?tid=&dtml-tid;">Show only summary</a>
<dtml-else>
 <dtml-call "REQUEST.set('span', 1)">
 <a href="&dtml-URL0;?tid=&dtml-tid;&amp;show_all=1">Show min/max as well</a>
</dtml-if>

<dtml-with "aggregateDetailResults(tid)">

 <table border=0 cellspacing=0 cellpadding=2 width="100%">

 <tr><td colspan="<dtml-var "span*3 + 2">"><b>&dtml-url;</b>
     (total: <dtml-var min_time_total fmt="%.2fs"> /
		<dtml-var ave_time_total fmt="%.2fs"> /
		<dtml-var max_time_total fmt="%.2fs">)</td></tr>

 <tr class="list-header">
  <th colspan="&dtml-span;" class="list-header" width="1%%" align="left">Elapsed</th>
  <th colspan="&dtml-span;" class="list-header" width="1%%" align="left">Time&nbsp;Spent</th>
  <th colspan="&dtml-span;" class="list-header" width="1%%" align="left">Percentage</th>
  <th class="list-header" width="1%%" align="left">Call&nbsp;Total&nbsp;%</th>
  <th class="list-header" align="left">Action</th>
 </tr>

 <dtml-if show_all>
  <tr class="list-header">
   <th>min</th><th>ave</th><th>max</th>
   <th>min</th><th>ave</th><th>max</th>
   <th>min</th><th>ave</th><th>max</th>
  </tr>
 </dtml-if>

 <dtml-in listEvents mapping>
  <tr class="<dtml-if sequence-odd>row-hilite<dtml-else>row-normal</dtml-if>">

    <dtml-if show_all>
     <td align="center" class="location-bar">
      <dtml-if min_time_elapsed>+<dtml-var min_time_elapsed fmt="%2.4f">s
      <dtml-else>&nbsp;</dtml-if>
     </td>
    </dtml-if>

    <td align="center" class="location-bar">
      <dtml-if ave_time_elapsed>+<dtml-var ave_time_elapsed fmt="%2.4f">s
      <dtml-else>&nbsp;</dtml-if>
    </td>

    <dtml-if show_all>

     <td align="center" class="location-bar">
      <dtml-if max_time_elapsed>+<dtml-var max_time_elapsed fmt="%2.4f">s
      <dtml-else>&nbsp;</dtml-if>
     </td>
     <td align="center"><dtml-var min_time_display fmt="%2.4f">s</td>
     <td align="center"><dtml-var time_display fmt="%2.4f">s</td>
     <td align="center"><dtml-var max_time_display fmt="%2.4f">s</td>

     <td align="center"><dtml-var min_percentage_display fmt="%2.1f"></td>
     <td align="center" <dtml-if colour>bgcolor="&dtml-colour;"</dtml-if>>
      <dtml-var percentage_display fmt="%2.1f">%
     </td>
     <td align="center"><dtml-var max_percentage_display fmt="%2.1f"></td>

    <dtml-else>

     <td align="center"><dtml-var time_display fmt="%2.4f">s</td>
     <td align="center" <dtml-if colour>bgcolor="&dtml-colour;"</dtml-if>>
      <dtml-var percentage_display fmt="%2.1f">%
     </td>

    </dtml-if>

    <dtml-if ave_time_processing>
     <td align="center"><dtml-var ave_percentage fmt="%2.1f">%</td>
    <dtml-else>
     <td>&nbsp;</td>
    </dtml-if>

    <td>
     <dtml-if object><tt>&dtml-treepart;</tt><dtml-if icon><img
src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;"></dtml-if>
       &dtml-object;
       &dtml-str_call_count;
     <dtml-else><tt>&dtml-treepart; |</tt></dtml-if>
     <dtml-if cache><dtml-if "cache == 'hit'">(cache hit)</dtml-if></dtml-if>

    </td>
  </tr>
 </dtml-in>

</dtml-with>

<dtml-else>
 <font color="red">Invalid session ID: "&dtml-tid;"</font>
</dtml-if>

<dtml-var manage_page_footer>



=== Added File Zope/lib/python/Products/CallProfiler/dtml/aggregates.dtml ===
<dtml-var manage_page_header>
<dtml-var manage_tabs>

<form action="clear"><input type="submit" value="clear"></form>

<table border=0 width="90%" cellspacing=0 cellpadding=2>
<tr class="list-header">
    <td rowspan=2 align="center" valign="bottom">
        <dtml-var "sortcol('url', 'URL (click for detail)', 1)"></td>
    <td rowspan=2 align="center" valign="bottom">
        <dtml-var "sortcol('num_runs', 'Matches')"></td>
    <td rowspan=2 align="center" valign="bottom">
        <dtml-var "sortcol('num_events', 'Calls')"></td>
    <td colspan=2 align="center">Cache</td>
    <td colspan=3 align="center">Total time</td>
    <td rowspan=2 align="center" valign="bottom">Transactions</td>
</tr>
<tr class="list-header">
    <td><dtml-var "sortcol('num_cache_hit', 'hit')"></td>
    <td><dtml-var "sortcol('num_cache_miss', 'miss')"></td>
    <td><dtml-var "sortcol('min_time_total', 'min')"></td>
    <td><dtml-var "sortcol('ave_time_total', 'ave')"></td>
    <td><dtml-var "sortcol('max_time_total', 'max')"></td>
</tr>

<dtml-in aggregateResults>
 <tr  class="<dtml-if sequence-odd>row-hilite<dtml-else>row-normal</dtml-if>">
  <td><a href="aggregateDetail?tid=<dtml-var "tids[0]" html_quote>">&dtml-truncated_url;</a></td>
  <td>&dtml-num_runs;</td>
  <td>&dtml-num_event;</td>
  <td>&dtml-num_cache_hit;</td>
  <td>&dtml-num_cache_miss;</td>
  <td><dtml-var min_time_total fmt="%2.4f"></td>
  <td><dtml-var ave_time_total fmt="%2.4f"></td>
  <td><dtml-var max_time_total fmt="%2.4f"></td>
  <td><small><dtml-in getTransactions>
     <a href="detail?tid=&dtml-tid;"><dtml-var time_total fmt="%2.4f"></a><dtml-unless sequence-end>, </dtml-unless>
  </dtml-in></small></td>
 </tr>
</dtml-in>

</table>

<form action="clear"><input type="submit" value="clear"></form>

<dtml-var manage_page_footer>


=== Added File Zope/lib/python/Products/CallProfiler/dtml/configure.dtml ===
<dtml-var manage_page_header>

<dtml-var manage_tabs>

<form action="clear" method="POST">
<input type="submit" value="Clear results">
</form>

Publisher Hook is
<dtml-if isPublisherHookInstalled>
 <font color="green">installed</font>
<dtml-else>
 <font color="red">not installed</font>
</dtml-if>
<br>
Cache Hook is
<dtml-if isCacheHookInstalled>
 <font color="green">installed</font>
<dtml-else>
 <font color="red">not installed</font>
</dtml-if>

<form action="&dtml-URL1;" method="POST">

<dtml-in getComponentModules>
 <dtml-if icon>
  <img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;" 
  title="&dtml-meta_type;" border="0" />
 </dtml-if>
<dtml-var checkbox>
<br>
</dtml-in>

<input type="submit" name="configure:method" value="Monitor selected calls">
<input type="submit" name="monitorAll:method" value="Monitor all">
<input type="submit" name="monitorNone:method" value="Monitor none">
</form>

<h3>Add a Module</h3>

<p class="form-help">
 Add a (temporary) module to the list above;  modules added here
 will disappear when Zope is restartedor when the CallProfiler product
 is refreshed.
</p>

<form action="&dtml-URL1;/addModule" method="POST">

<table>
<tr>
 <th align="right" class="form-label">Module Path</th>
 <td><input type="text" name="dotted_module" value="" size="40"></td>
 <td class="form-help">Dotted path, e.g.'Products.FooProduct.FooThing'</td>
</tr>

<tr>
 <th align="right" class="form-label">Class name</th>
 <td><input type="text" name="class_name" value=""></td>
 <td class="form-help"> Name of class (no spaces!), e.g, 'FooThing' </span>
</tr>

<tr>
 <th align="right" class="form-label">Method</th>
 <td><input type="text" name="method" value=""></td>
 <td class="form-help">Name of class method (no spaces!), e.g, 'showFoo'</td>
</tr>

<tr>
 <td><br /></td>
 <td> <input type="submit" value=" Add "> </td>
 <td><br /></td>
</tr>

</table>
</form>

<h3> Remove a Module </h3>

<p class="form-help">
 Remove a module from the list above;  note that modules removed here
 may reaappear when Zope is restarted or when the CallProfiler product
 is refreshed (if they are hard-wired into the product).
</p>

<form action="&dtml-URL1;/removeModule" method="POST">
<table>
<tr>
 <th align="right" class="form-label">Name</th>
 <td>
   <select name="name">
   <dtml-in getComponentModules>
    <option value="&dtml-name;">&dtml-name;</option>
   </dtml-in>
   </select>
 </td>
</tr>

<tr>
 <td><br /></td>
 <td> <input type="submit" value=" Remove "> </td>
</tr>

</table>
</form>


<dtml-var manage_page_footer>


=== Added File Zope/lib/python/Products/CallProfiler/dtml/detail.dtml ===

<dtml-if "validTID(tid)">
<dtml-with "detailResults(tid)">
 <table border=0 cellspacing=0 cellpadding=2 width="100%">

 <tr>
  <td colspan=6><b>&dtml-url;</b> (total: <dtml-var time_total fmt="%.2fs">)</td>
 </tr>

 <tr class="list-header">
  <th class="list-header" width="1%%" align="left">Elapsed</th>
  <th class="list-header" width="1%%" align="left">Time&nbsp;Spent</th>
  <th class="list-header" width="1%%" align="left">Percentage</th>
  <th class="list-header" width="1%%" align="left">Call&nbsp;Total&nbsp;%</th>
  <th class="list-header" align="left">Action</th>
 </tr>

 <dtml-in listEvents mapping>
  <tr class="<dtml-if sequence-odd>row-hilite<dtml-else>row-normal</dtml-if>">
    <td class="location-bar">
      <dtml-if time_elapsed>+<dtml-var time_elapsed fmt="%2.4f">
      <dtml-else>&nbsp;</dtml-if>
    </td>
    <td align="center">
     <dtml-var time_display fmt="%2.4f">
    </td>
    <td align="center" <dtml-if colour>bgcolor="&dtml-colour;"</dtml-if>>
     <dtml-var percentage_display fmt="%2.1f">%
    </td>
    <dtml-if time_processing>
     <td align="center"><dtml-var percentage fmt="%2.1f">%</td>
    <dtml-else>
     <td>&nbsp;</td>
    </dtml-if>
    <td>
     <dtml-if object><tt>&dtml-treepart;</tt><dtml-if icon><img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;"></dtml-if>
	&dtml-object;
	&dtml-str_call_count;
     <dtml-else><tt>&dtml-treepart; |</tt></dtml-if>
     <dtml-if cache><dtml-if "cache == 'hit'">(cache hit)</dtml-if></dtml-if>
    </td>
  </tr>
 </dtml-in>

 </table>
</dtml-with>

<dtml-else>
 <font color="red">Invalid session ID: "&dtml-tid;"</font>
</dtml-if>


=== Added File Zope/lib/python/Products/CallProfiler/dtml/results.dtml ===
<dtml-var manage_page_header>
<dtml-var manage_tabs>

<form action="clear"><input type="submit" value="clear"></form>

<table width="90%" border=0 cellspacing=0 cellpadding=2>
<tr class="list-header"><td rowspan=2 align="center" valign="bottom">
	<dtml-var "sortcol('time_start', 'Time', 1)"></td>
    <td rowspan=2 align="center" valign="bottom">
	<dtml-var "sortcol('time_total', 'Total time')"></td>
    <td rowspan=2 align="center" valign="bottom">
	<dtml-var "sortcol('url', 'URL')"></td>
    <td rowspan=2 align="center" valign="bottom">
	<dtml-var "sortcol('num_event', 'Calls')"></td>
    <td colspan=2 align="center">Cache</td>
</tr>
<tr class="list-header">
    <td align="center"><dtml-var "sortcol('num_cache_hit', 'hits')"></td>
    <td align="center"><dtml-var "sortcol('num_cache_miss', 'misses')"></td>
</tr>

<dtml-in summary>
 <tr class="<dtml-if sequence-odd>row-hilite<dtml-else>row-normal</dtml-if>">
  <td><a href="results?tid=&dtml-tid;">&dtml-str_time_start;</a></td>
  <td><dtml-var time_total fmt="%2.4f"></td>
  <td>&dtml-url;</td>
  <td>&dtml-num_event;</td>
  <td>&dtml-num_cache_hit;</td>
  <td>&dtml-num_cache_miss;</td>
 </tr>
</dtml-in>

</table>

<dtml-if tid><dtml-var "detail(this(), REQUEST, tid=tid)"></dtml-if>

<form action="clear"><input type="submit" value="clear"></form>

<dtml-var manage_page_footer>