diff roundup/cgi/client.py @ 2237:f624fc20f8fe

added capturing of stats
author Richard Jones <richard@users.sourceforge.net>
date Sun, 25 Apr 2004 22:19:15 +0000
parents 3d9bb1a052d1
children ac4f295499a4
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sat Apr 24 22:59:12 2004 +0000
+++ b/roundup/cgi/client.py	Sun Apr 25 22:19:15 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.172 2004-04-22 22:16:36 richard Exp $
+# $Id: client.py,v 1.173 2004-04-25 22:19:15 richard Exp $
 
 """WWW request handler (also used in the stand-alone server).
 """
@@ -519,7 +519,14 @@
             result = pt.render(self, None, None, **args)
             self.additional_headers['Content-Type'] = pt.content_type
             if os.environ.get('CGI_SHOW_TIMING', ''):
-                s = '<p>Time elapsed: %fs</p></body>'%(time.time()-self.start)
+                s = '<p>Time elapsed: %fs</p>'%(time.time()-self.start)
+                if hasattr(self.db, 'stats'):
+                    s += '''<p>Cache hits: %(cache_hits)d,
+                        misses %(cache_misses)d.
+                        Loading items: %(get_items)f secs.
+                        Filtering: %(filtering)f secs.
+                        </p>'''%self.db.stats
+                s += '</body>'
                 result = result.replace('</body>', s)
             return result
         except templating.NoTemplate, message:

Roundup Issue Tracker: http://roundup-tracker.org/