Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Private Attributes
MoinMoin.web.profile.ProfilerMiddleware Class Reference
Inheritance diagram for MoinMoin.web.profile.ProfilerMiddleware:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def profile
def run_profile
def shutdown

Public Attributes

 app

Static Private Attributes

 __call__ = profile

Detailed Description

Abstract base class for profiling middlewares.

Concrete implementations of this class should provide implementations
of `run_profile` and `shutdown`, the latter which should be called by
the code utilizing the profiler.

Definition at line 26 of file profile.py.


Constructor & Destructor Documentation

Definition at line 33 of file profile.py.

00033 
00034     def __init__(self, app):
00035         self.app = app


Member Function Documentation

def MoinMoin.web.profile.ProfilerMiddleware.profile (   self,
  environ,
  start_response 
)
Profile the request. Exceptions encountered during the profile are
logged before being propagated for further handling.

Definition at line 36 of file profile.py.

00036 
00037     def profile(self, environ, start_response):
00038         """
00039         Profile the request. Exceptions encountered during the profile are
00040         logged before being propagated for further handling.
00041         """
00042         method = environ.get('REQUEST_METHOD', 'GET')
00043         url = get_current_url(environ)
00044         logging.debug("Profiling call for '%s %s'", method, url)
00045         try:
00046             res = self.run_profile(self.app, (environ, start_response))
00047         except Exception, e:
00048             logging.exception("Exception while profiling '%s %s'", method, url)
00049             raise
00050         return res

Here is the call graph for this function:

def MoinMoin.web.profile.ProfilerMiddleware.run_profile (   self,
  app,
  args,
  kwargs 
)
Override in subclasses.

Several profilers available for python use the same call signature,
therefore simplifying the implementation.

Reimplemented in MoinMoin.web.profile.PycallgraphMiddleware.

Definition at line 53 of file profile.py.

00053 
00054     def run_profile(self, app, *args, **kwargs):
00055         """ Override in subclasses.
00056 
00057         Several profilers available for python use the same call signature,
00058         therefore simplifying the implementation.
00059         """
00060         raise NotImplementedError()

Here is the caller graph for this function:

Override in subclasses to clean up when server/script shuts down. 

Reimplemented in MoinMoin.web.profile.PycallgraphMiddleware, MoinMoin.web.profile.HotshotMiddleware, and MoinMoin.web.profile.CProfileMiddleware.

Definition at line 61 of file profile.py.

00061 
00062     def shutdown(self):
00063         """ Override in subclasses to clean up when server/script shuts down. """
00064         pass

Here is the caller graph for this function:


Member Data Documentation

Definition at line 51 of file profile.py.

Definition at line 34 of file profile.py.


The documentation for this class was generated from the following file: