details: http://www.bx.psu.edu/hg/galaxy/rev/04ad7a4b5c56 changeset: 3270:04ad7a4b5c56 user: Nate Coraor <nate@bx.psu.edu> date: Tue Jan 26 10:23:45 2010 -0500 description: merge diffstat: eggs.ini | 4 +--- lib/galaxy/web/buildapp.py | 7 +------ lib/galaxy/web/framework/base.py | 5 +---- lib/galaxy/web/framework/memdebug.py | 26 -------------------------- 4 files changed, 3 insertions(+), 39 deletions(-) diffs (96 lines): diff -r 8b4e25dc5d08 -r 04ad7a4b5c56 eggs.ini --- a/eggs.ini Mon Jan 25 13:05:41 2010 -0500 +++ b/eggs.ini Tue Jan 26 10:23:45 2010 -0500 @@ -24,7 +24,6 @@ python_lzo = 1.08 threadframe = 0.2 guppy = 0.1.8 -PSI = 0.3b1.1 [eggs:noplatform] amqplib = 0.6.1 @@ -93,7 +92,6 @@ Paste = http://cheeseshop.python.org/packages/source/P/Paste/Paste-1.6.tar.gz PasteDeploy = http://cheeseshop.python.org/packages/source/P/PasteDeploy/PasteDeploy-1.3.3... PasteScript = http://cheeseshop.python.org/packages/source/P/PasteScript/PasteScript-1.7.3... -PSI = http://pypi.python.org/packages/source/P/PSI/PSI-0.3b1.1.tar.gz Routes = http://pypi.python.org/packages/source/R/Routes/Routes-1.11.tar.gz simplejson = http://cheeseshop.python.org/packages/source/s/simplejson/simplejson-1.5.tar... SQLAlchemy = http://dist.g2.bx.psu.edu/SQLAlchemy-0.5.6_r6498.tar.bz2 @@ -106,4 +104,4 @@ wsgiref = http://pypi.python.org/packages/source/w/wsgiref/wsgiref-0.1.2.zip Babel = http://ftp.edgewall.com/pub/babel/Babel-0.9.4.zip wchartype = http://ginstrom.com/code/wchartype-0.1.zip -boto = http://boto.googlecode.com/files/boto-1.8d.tar.gz \ No newline at end of file +boto = http://boto.googlecode.com/files/boto-1.8d.tar.gz diff -r 8b4e25dc5d08 -r 04ad7a4b5c56 lib/galaxy/web/buildapp.py --- a/lib/galaxy/web/buildapp.py Mon Jan 25 13:05:41 2010 -0500 +++ b/lib/galaxy/web/buildapp.py Tue Jan 26 10:23:45 2010 -0500 @@ -65,12 +65,7 @@ sys.exit( 1 ) atexit.register( app.shutdown ) # Create the universe WSGI application - if app.config.log_memory_usage: - from galaxy.web.framework.memdebug import MemoryLoggingWebApplication - webapp = MemoryLoggingWebApplication( app, session_cookie='galaxysession' ) - else: - webapp = galaxy.web.framework.WebApplication( app, session_cookie='galaxysession' ) - # Find controllers + webapp = galaxy.web.framework.WebApplication( app, session_cookie='galaxysession' ) add_controllers( webapp, app ) # Force /history to go to /root/history -- needed since the tests assume this webapp.add_route( '/history', controller='root', action='history' ) diff -r 8b4e25dc5d08 -r 04ad7a4b5c56 lib/galaxy/web/framework/base.py --- a/lib/galaxy/web/framework/base.py Mon Jan 25 13:05:41 2010 -0500 +++ b/lib/galaxy/web/framework/base.py Tue Jan 26 10:23:45 2010 -0500 @@ -122,7 +122,7 @@ # Special key for AJAX debugging, remove to avoid confusing methods kwargs.pop( '_', None ) try: - body = self.call_body_method( method, trans, kwargs ) + body = method( trans, **kwargs ) except Exception, e: body = self.handle_controller_exception( e, trans, **kwargs ) if not body: @@ -140,9 +140,6 @@ trans.response.wsgi_headeritems() ) return self.make_body_iterable( trans, body ) - def call_body_method( self, method, trans, kwargs ): - return method( trans, **kwargs ) - def make_body_iterable( self, trans, body ): if isinstance( body, ( types.GeneratorType, list, tuple ) ): # Recursively stream the iterable diff -r 8b4e25dc5d08 -r 04ad7a4b5c56 lib/galaxy/web/framework/memdebug.py --- a/lib/galaxy/web/framework/memdebug.py Mon Jan 25 13:05:41 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -""" -Implementation of WebApplication that logs memory usage before and after -calling each controller method. -""" - -import pkg_resources -pkg_resources.require( "PSI" ) -import psi.process - -import os -import logging - -from galaxy.web.framework import WebApplication - -log = logging.getLogger( __name__ ) -pid = os.getpid() - -class MemoryLoggingWebApplication( WebApplication ): - def call_body_method( self, method, trans, kwargs ): - cls = method.im_class - process = psi.process.Process( pid ) - log.debug( "before controller=%s.%s method=%s rss=%d vsz=%d", cls.__module__, cls.__name__, method.__name__, process.rss, process.vsz ) - rval = method( trans, **kwargs ) - process = psi.process.Process( pid ) - log.debug( "after controller=%s.%s method=%s rss=%d vsz=%d", cls.__module__, cls.__name__, method.__name__, process.rss, process.vsz ) - return rval \ No newline at end of file
participants (1)
-
Greg Von Kuster