~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/middleware/profile.py

  • Committer: John Arbash Meinel
  • Date: 2011-03-19 08:35:57 UTC
  • mfrom: (422.3.2 head_middleware)
  • Revision ID: john@arbash-meinel.com-20110319083557-k8mbbkr3bzisz3ob
include HeadMiddleware so that we can be sure HEAD requests never return BODY content.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
from bzrlib.lsprof import profile
6
6
 
 
7
 
7
8
class LSProfMiddleware(object):
8
9
    """Paste middleware for profiling with lsprof."""
9
10
 
26
27
        try:
27
28
            ret, stats = profile(self.__run_app, environ, start_response)
28
29
            self.__count += 1
29
 
            stats.save("%d-stats.callgrind" % self.__count, format="callgrind")
 
30
            stats.save("%d-stats.callgrind" % (self.__count,), format="callgrind")
30
31
            return ret
31
32
        finally:
32
33
            self.lock.release()