>> I can't help with CherryPy 3, as I never used it much, but you might want
>> to try with a framework agnostic solution like repoze.profile which
>> should
>> work also with TG1.5
>>
>> Before the TurboGears DebugBar had built-in support for profiling it was
>> the tool I used most for code profiling and you can mount it as a plain
>> WSGI middleware around any application:
>>
>> http://docs.repoze.org/profile/
Thanks again for the idea, it looks like repoze.profile would be great
indeed. Trouble is I don't fully understand how I should use it with
tg 1.5 but I guess somehow it must be possible since you say this
method is framework agnostic.
In the repoze.profile doc they say one would turn on profiling by
#############################################################
from repoze.profile import ProfileMiddleware
middleware = ProfileMiddleware(
app,
log_filename='/foo/bar.log',
cachegrind_filename='/foo/cachegrind.out.bar',
discard_first_request=True,
flush_at_shutdown=True,
path='/__profile__',
unwind=False,
)
############################################################
But where should I include these lines of code? I start my tg 1.5 app
by running start-myappname.py which contains:
############################################################
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Start script for the myappname TurboGears project.
This script is only needed during development for running from the project
directory. When the project is installed, easy_install will create a
proper start script.
"""
import sys
from myappname.command import start, ConfigurationError
if __name__ == '__main__':
try:
start( )
except ConfigurationError, exc:
sys.stderr.write( str( exc ) )
sys.exit( 1 )
################################################################
And the function start( ) is from turbogears/startup.py.
So where would I include the profiling stuff given by the repoze.profile docs?
Cheers,
Daniel
> Thanks, I'll have a look!
>
>
>> On Tue, Sep 30, 2014 at 9:59 AM, fetchinson . <[email protected]>
>> wrote:
>>
>>> I'd like to use the built-in cherrypy profiler with a tg 1.5
>>> application and it looks like the docs are out of date: the page
>>> http://www.turbogears.org/1.0/docs/Optimization.html#profiling refers
>>> to cherrypy 2.x but tg 1.5 comes with cherrypy 3.x and profiling I
>>> think changed. I found some info on
>>> http://stackoverflow.com/questions/16630208/profiling-cherrypy which I
>>> guess refers to cherrypy 3.x but in order to use that I'd need to go
>>> into the tg source (I guess).
>>>
>>> What's the ideal and "official" way to use the built-in cherrypy
>>> profiler (and especially the web based reporting tool of cherrypy
>>> profiler.py) with tg 1.5?
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> --
>>> Psss, psss, put it down! - http://www.cafepress.com/putitdown
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "TurboGears" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/turbogears.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/turbogears.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Psss, psss, put it down! - http://www.cafepress.com/putitdown
>
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.