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.
--~--~---------~--~----~------------~-------~--~----~
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