~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/middleware/profile.py

  • Committer: Martin Albisetti
  • Date: 2009-10-02 09:18:10 UTC
  • Revision ID: martin.albisetti@canonical.com-20091002091810-64p69q85o0r169m2
Add to the readme how to run loggerhead tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'''Profiling middleware for paste.'''
2
 
import cgi
3
 
import logging
4
 
import sys
 
1
"""Profiling middleware for Paste."""
 
2
 
5
3
import threading
6
4
 
7
5
from bzrlib.lsprof import profile
8
 
from guppy import hpy
9
6
 
10
7
class LSProfMiddleware(object):
11
 
    '''Paste middleware for profiling with lsprof.'''
 
8
    """Paste middleware for profiling with lsprof."""
12
9
 
13
10
    def __init__(self, app, global_conf=None):
14
11
        self.app = app
33
30
            return ret
34
31
        finally:
35
32
            self.lock.release()
36
 
 
37