Part of lp.services.profile
|Class||ProfilingOops||Fake exception used to log OOPS information when profiling pages.|
|Class||Profiler||No class docstring; 2/4 methods documented|
|Class||Profilers||A simple subclass to initialize our thread local values.|
|Function||before_traverse||Handle profiling when enabled via the profiling.enabled feature flag.|
|Function||start_request||Handle profiling when configured as permitted.|
|Function||end_request||If profiling is turned on, save profile data for the request.|
|Function||get_desired_profile_actions||What does the URL show that the user wants to do about profiling?|
|Class||ProfileNamespace||A see-through namespace that handles traversals with ++profile++.|
|Function||_maybe_profile||Setup profiling as requested.|
|Function||_make_startswith||Return a function that returns true if its argument startswith value|
|Function||_make_endswith||Return a function that returns true if its argument endswith value|
|Function||_make_includes||Return a function that returns true if its argument includes value|
|Function||_make_condition_function||Given DSL string, return dict including function implementing string.|
If profiling is enabled, start a profiler for this thread. If memory profiling is requested, save the VSS and RSS.
If already profiling, this is a no-op.
Returns a set of actions (comma-separated) if ++profile++ is in the URL. Note that ++profile++ alone without actions is interpreted as the "help" action.
DSL is very simple. Conditions are separated by semicolons, which represent logical or. Each condition should begin with (case insensitive) "startswith ", "endswith ", or "includes ". The part of the condition after this word and before the next semicolon or end-of-string is the match string, which is case-insensitive and whitespace-normalized.
Returned dict has three elements: the function that implements the DSL, the list of conditions that were included, and the list of conditions that were excluded (because they were not understood).