[Zope-Checkins] CVS: Zope/lib/python/App/dtml - activity.dtml:1.1.2.1

Shane Hathaway shane@cvs.zope.org
Fri, 31 May 2002 16:23:22 -0400


Update of /cvs-repository/Zope/lib/python/App/dtml
In directory cvs.zope.org:/tmp/cvs-serv30758/lib/python/App/dtml

Added Files:
      Tag: shane-activity-monitoring-branch
	activity.dtml 
Log Message:
Added an activity monitor to the Database control panel.  It is a bar graph
that shows how many objects have been loaded and stored recently.  It's
good for:

- discovering excessive loading, meaning you should raise the cache size;

- discovering excessive storing, meaning your application may be writing too
  often; and

- getting a general handle on the activity of your database.


=== Added File Zope/lib/python/App/dtml/activity.dtml ===
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<h3>Recent Database Activity</h3>

<dtml-with expr="getActivityChartData(200, REQUEST)" mapping>
<table>
<tr>
 <th valign="top">Keep History (seconds)</th>
 <td>
  <form method="POST" action="&dtml-URL1;/manage_setHistoryLength">
   <input type="text" name="length" value="&dtml-getHistoryLength;" />
   <input type="submit" name="submit" value="Save changes" />
  </form>
 </td>
</tr>
<tr>
 <th valign="top">Displayed Range</th>
 <td>&dtml-start_time; to<br />
     &dtml-end_time;</td>
</tr>
<tr>
 <th></th>
 <td>
  <form method="GET" action="&dtml-URL;">
   <input type="submit" name="submit" value="Show current chart" />
  </form>
 </td>
</tr>
</table>
<p></p>
<div align="center">
<table style="border: solid thin black;">
<tr>
<td></td>
<dtml-in divs mapping>
<dtml-let url="REQUEST['URL'] + ('?chart_start=%s&chart_end=%s'
               % (start, end))">
 <td height="200" width="32"><a href="&dtml-url;"><dtml-if
   trans_len><img src="transparent_bar" width="32"
   height="&dtml-trans_len;" border="0" /><br /></dtml-if><dtml-if
   store_len><img src="store_bar" width="32"
   height="&dtml-store_len;" border="0" /><br /></dtml-if><dtml-if
   load_len><img src="load_bar" width="32"
   height="&dtml-load_len;" border="0" /></dtml-if></a></td>
</dtml-let>
</dtml-in>
</tr>

<tr>
 <th align="left"><font color="#ff0000">Object stores</font></th>
<dtml-in divs mapping>
 <td align="right"><dtml-let url="REQUEST['URL'] +
     ('?chart_start=%s&chart_end=%s'
     % (start, end))"><a href="&dtml-url;"><font
     color="#ff0000">&dtml-store_count;</font></a></dtml-let></td>
</dtml-in>
 <th align="left">&nbsp; Total:
   <font color="#ff0000">&dtml-total_store_count;</font>
 </th>
</tr>


<tr>
 <th align="left" valign="top"><font color="#000080">Object loads</font></th>
<dtml-in divs mapping>
 <td align="right"><dtml-let url="REQUEST['URL'] +
     ('?chart_start=%s&chart_end=%s'
     % (start, end))"><a href="&dtml-url;"><font
     color="#000080">&dtml-load_count;</font></a></dtml-let><br />
     <font size="-2">&dtml-time_offset;</font></td>
</dtml-in>
 <th align="left" valign="top">&nbsp; Total:
   <font color="#000080">&dtml-total_load_count;</font>
 </th>
</tr>



</table>
</div>
</dtml-with>

<dtml-var manage_page_footer>