File manager - Edit - /opt/imh-python/lib/python2.7/site-packages/werkzeug/contrib/profiler.pyo
Back
� �_Sc @ s� d Z d d l Z d d l Z d d l Z yR y d d l m Z Wn! e k rd d d l m Z n Xd d l m Z e Z Wn e k r� e Z n Xd e f d � � YZ d e f d � � YZ d d e d d d d d � Z d S( s9 werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provided (defaults to stderr). Example usage:: from werkzeug.contrib.profiler import ProfilerMiddleware app = ProfilerMiddleware(app) :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. i����N( t Profile( t Statst MergeStreamc B s e Z d Z d � Z d � Z RS( s� An object that redirects `write` calls to multiple streams. Use this to log to both `sys.stdout` and a file:: f = open('profiler.log', 'w') stream = MergeStream(sys.stdout, f) profiler = ProfilerMiddleware(app, stream) c G s"