The following is the WSGI profile middleware for WHIFF (currently only available from the Mercury Repository):
profile.py . That should get you started. If you want to change it to run outside of the WHIFF context, change the line
gateway.putResource(env, resourcePath, report)
to something like
file("/tmp/profile.txt", "w").write(report)
source
share