edX Solutions Team: Runtime Profiler contribution

Background:  The edX Solutions Team undertook an intensive round of performance profiling for a recent client.  As part of the engagement, we constructed a runtime code analysis tool using the Hotshot and CProfile profiler libraries.  The tool was used to monitor code/function execution times as well as document code execution paths for specific workflows.

Studio Updates: None

LMS Updates:  Feature flags added to devstack and test env files

Configuration/Testing:  A feature flag is available in devstack.py for manual code profiling.  In addition, a flag is available in test.py for automated profiling via unit tests.  To use the profiler, the following conditions must be met:

1) An inbound view URL must contain "prof=1" in the query string
2) The DEBUG environment parameter must be set to True, or the authenticated user must be configured as a superuser (user.is_superuser = True).

The default output for the profiler is to the console, however, alternate output formats can be specified, including to browser and file.  Multiple output formats are available, including the default statistical report, graphical call tree, and raw (binary) data.
Mistakenly left in? Or intentional? I see other prints below, so maybe intentional for debugging purposes?