# HG changeset patch --
Bitbucket.org
# Project galaxy-dist
# URL
http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1277831187 14400
# Node ID 072d5f7ba872c828fc21f6ddd9e8485deded89d3
# Parent b4237641ca4d28631c9e65c726693057d4b8dab3
Remove the rest of the memory_usage debugging module since all of its calls were removed
from controller methods.
--- a/lib/galaxy/util/memory_usage.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import os, platform, logging
-from galaxy.datatypes.data import nice_size
-
-log = logging.getLogger( __name__ )
-
-_proc_status = '/proc/%d/status' % os.getpid()
-
-_scale = { 'kB': 1024.0, 'mB': 1024.0*1024.0, 'KB': 1024.0,
'MB': 1024.0*1024.0 }
-
-def _VmB( VmKey ):
- '''Private.
- '''
- global _proc_status, _scale
- # get pseudo file /proc/<pid>/status
- try:
- t = open( _proc_status )
- v = t.read()
- t.close()
- except:
- log.debug("memory_usage is currently supported only on Linux, your platform
is %s %s" % ( platform.system(), platform.release() ) )
- return 0.0 # non-Linux?
- # get VmKey line e.g. 'VmRSS: 9999 kB\n ...'
- i = v.index( VmKey )
- v = v[ i: ].split( None, 3 ) # whitespace
- if len( v ) < 3:
- return 0.0 # invalid format?
- # convert Vm value to bytes
- return float( v[ 1 ] ) * _scale[ v[ 2 ] ]
-def memory( since=0.0, pretty=False ):
- '''Return memory usage in bytes.
- '''
- size = _VmB( 'VmSize:' ) - since
- if pretty:
- return nice_size( size )
- else:
- return size
-def resident( since=0.0 ):
- '''Return resident memory usage in bytes.
- '''
- return _VmB( 'VmRSS:' ) - since
-def stacksize( since=0.0 ):
- '''Return stack size in bytes.
- '''
- return _VmB( 'VmStk:' ) - since
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -64,10 +64,6 @@ class UniverseApplication( object ):
from galaxy.util import memdump
if memdump.Memdump:
self.memdump = memdump.Memdump()
- # Enable memory_usage logging if configured
- if self.config.log_memory_usage:
- from galaxy.util import memory_usage
- self.memory_usage = memory_usage
# Start the job queue
self.job_manager = jobs.JobManager( self )
# FIXME: These are exposed directly for backward compatibility
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -80,7 +80,6 @@ class Configuration( object ):
self.pbs_stage_path = kwargs.get('pbs_stage_path', "" )
self.use_heartbeat = string_as_bool( kwargs.get( 'use_heartbeat',
'False' ) )
self.use_memdump = string_as_bool( kwargs.get( 'use_memdump',
'False' ) )
- self.log_memory_usage = string_as_bool( kwargs.get( 'log_memory_usage',
'False' ) )
self.log_actions = string_as_bool( kwargs.get( 'log_actions',
'False' ) )
self.log_events = string_as_bool( kwargs.get( 'log_events',
'False' ) )
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites',
"main,test,archaea,ucla" ).lower().split(",")