~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/middleware/profile.py

  • Committer: Matt Nordhoff
  • Date: 2009-10-17 06:19:40 UTC
  • mto: (329.2.2 trailing-whitespace)
  • mto: This revision was merged to the branch mainline in revision 392.
  • Revision ID: mnordhoff@mattnordhoff.com-20091017061940-w9tcvy0xs1irno3y
Some random PEP 8 and otehr stylistic changes.

Show diffs side-by-side

added added

removed removed

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