[Grok-dev] a nice research project

Chris McDonough chrism at plope.com
Sat Feb 7 17:14:33 EST 2009

Martijn Faassen wrote:
> Hey,
> How one would do such research could be:
> * replicate the setup
> * place a "import pdb; pdb.set_trace()" in some function (like somewhere 
> in minidom or ZPT) that we don't understand gets called in this case.
> * start grok
> * make a request
> * in pdb, look at the 'bt' (backtrace), and perhaps use 'up' to walk up 
> the call chain, trying to understand what is triggering this.

You can also use repoze.profile
for this.  It's likely a lot easier than what's described above.

To install it into a grokproject-generated Grok instance add it to the eggs
section of the [app] section of your buildout:

recipe = zc.recipe.egg
eggs = helloworld

Then rerun buildout.

Put repoze.profile in the WSGI pipeline e.g.:

pipeline =

use = egg:Paste#http
host =
port = 8080

# set the name of the zope.conf file
zope_conf = %(here)s/zope.conf

Then restart your Grok app and unleash ab on the app.  When it's done, visit
http://localhost:8080/__profile__, and in the "mode" dropdown, select "callers",
then click "Update".  It will show you in the left hand column the function that
was called; in the right hand column the callers of that function.

- C

More information about the Grok-dev mailing list