mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Remove the rest of the memory_usage debugging module since all of its calls were removed from controller methods.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(",")
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user