Rev 413: Make some of the info calls a bit less noisy. in http://bazaar.launchpad.net/~jameinel/loggerhead/configurable_logging
John Arbash Meinel
john at arbash-meinel.com
Mon Apr 26 20:38:08 BST 2010
At http://bazaar.launchpad.net/~jameinel/loggerhead/configurable_logging
------------------------------------------------------------
revno: 413
revision-id: john at arbash-meinel.com-20100426193726-qfhu1t3pn7u1kq1g
parent: john at arbash-meinel.com-20100426190406-psgsbys8e33cpcbg
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: configurable_logging
timestamp: Mon 2010-04-26 14:37:26 -0500
message:
Make some of the info calls a bit less noisy.
We don't really need full floating point resolution, milliseconds should be enough.
-------------- next part --------------
=== modified file 'loggerhead/apps/branch.py'
--- a/loggerhead/apps/branch.py 2010-04-26 19:04:06 +0000
+++ b/loggerhead/apps/branch.py 2010-04-26 19:37:26 +0000
@@ -158,6 +158,9 @@
raise httpexceptions.HTTPMovedPermanently(
self._url_base + '/changes')
if path == 'static':
+ # TODO: Unfortunately, we still call Branch.open() even if we are
+ # serving a static path. This probably adds a fair amount of
+ # overhead...
return static_app(environ, start_response)
cls = self.controllers_dict.get(path)
if cls is None:
@@ -177,5 +180,5 @@
t = time.time()
val = do_stuff()
tdelta = time.time() - t
- self.log.info('Took %.3fs for: %s' % (tdelta, path_info))
+ self.log.info('Took %.3fs to generate: %s' % (tdelta, path_info))
return val
=== modified file 'loggerhead/controllers/__init__.py'
--- a/loggerhead/controllers/__init__.py 2009-10-17 08:59:33 +0000
+++ b/loggerhead/controllers/__init__.py 2010-04-26 19:37:26 +0000
@@ -92,7 +92,7 @@
vals.update(self.get_values(path, kwargs, headers))
- self.log.info('Getting information for %s: %r secs' % (
+ self.log.info('Getting information for %s: %.3f secs' % (
self.__class__.__name__, time.time() - z))
if 'Content-Type' not in headers:
headers['Content-Type'] = 'text/html'
@@ -103,7 +103,7 @@
template.expand_into(w, **vals)
w.flush()
self.log.info(
- 'Rendering %s: %r secs, %s bytes' % (
+ 'Rendering %s: %.3f secs, %s bytes' % (
self.__class__.__name__, time.time() - z, w.bytes))
return []
=== modified file 'loggerhead/wholehistory.py'
--- a/loggerhead/wholehistory.py 2009-10-21 14:40:23 +0000
+++ b/loggerhead/wholehistory.py 2010-04-26 19:37:26 +0000
@@ -80,6 +80,6 @@
if revid not in c[1]:
c[1] = c[1] + (revid,)
- log.info('built revision graph cache: %r secs' % (time.time() - z,))
+ log.info('built revision graph cache: %.3f secs' % (time.time() - z,))
return (_rev_info, _rev_indices)
More information about the bazaar-commits
mailing list