Thanks David,

As far as I can see from the CherryPy profiler code the second method
I describe is pretty much just a wrapper around the python profiler
module. I guess that option is pretty similar to the approach you
describe.

Best regards,
Jesper

On Feb 3, 7:45 pm, David Gardner <[email protected]> wrote:
> I have had luck profiling individual methods using the hotshot 
> profilerhttp://www.python.org/doc/2.5.2/lib/module-hotshot.html
>
>
>
> jlar wrote:
> > Hi people,
>
> > How do you profile your tg application (I am mainly interested in the
> > controller methods)? When I enable the cherrypy profiler:
>
> > profiling.on = True
> > profiling.path = "%(current_dir_uri)s/profiles"
>
> > I get profiles where all the CPU time is reported as used in
> > _build_dispatcher method in functions.py is always responsible for
> > most of the CPU usage (even though it is my application code which is
> > the culprit).
>
> > Alternatively when I try to profile each method individually I have
> > another problem:
>
> > from cherrypy.lib import profiler
> > class Root(controllers.RootController):
> >   p = profiler.Profiler("/home/myname/profiles")
>
> >   @expose(template="myproject.templates.index")
> >     def index(self):
> >       self.p.run(self._index)
>
> >     def _index(self):
> >       result = dict()
> >       # Do something
> >       return result
>
> > I get an error message that my method is not returning a basestring,
> > dict or generator (which is hardly surprising since I return None but
> > I don't know how to return my result dict. Does anyone know? Should I
> > simply make an extra call to _index in index:
>
> >       result = self.index()
> >       return result
>
> > or do you have a better idea?
>
> > Best regards,
> > Jesper
>
> > Btw. I asked about this issue some months ago with no answer. I hope I
> > am more fortunate this time.
>
> --
> David Gardner
> Pipeline Tools Programmer, "Sid the Science Kid"
> Jim Henson Creature Shop
> [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to