Remove memdump, which probably has not worked for many years.

This commit is contained in:
Nate Coraor
2015-01-28 16:20:30 -05:00
parent a65089669f
commit 23f3e479be
9 changed files with 1 additions and 185 deletions
-4
View File
@@ -629,10 +629,6 @@ use_interactive = True
# lot of CPU.
#use_heartbeat = False
# Enable the memory debugging interface (careful, negatively impacts server
# performance).
#use_memdump = False
# -- Data Libraries
# These library upload options are described in much more detail in the wiki:
-1
View File
@@ -26,7 +26,6 @@ pysam = 0.4.2
pysqlite = 2.5.6
python_lzo = 1.08_2.03_static
PyYAML = 3.10
guppy = 0.1.10
SQLAlchemy = 0.7.9
; msgpack_python = 0.2.4
+1 -8
View File
@@ -107,10 +107,8 @@ class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
self.quota_agent = galaxy.quota.QuotaAgent( self.model )
else:
self.quota_agent = galaxy.quota.NoQuotaAgent( self.model )
# Heartbeat and memdump for thread / heap profiling
# Heartbeat for thread profiling
self.heartbeat = None
self.memdump = None
self.memory_usage = None
# Container for OpenID authentication routines
if self.config.enable_openid:
from galaxy.web.framework import openid_manager
@@ -125,11 +123,6 @@ class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
self.heartbeat = heartbeat.Heartbeat( fname=self.config.heartbeat_log )
self.heartbeat.daemon = True
self.heartbeat.start()
# Enable the memdump signal catcher if configured and available
if self.config.use_memdump:
from galaxy.util import memdump
if memdump.Memdump:
self.memdump = memdump.Memdump()
# Transfer manager client
if self.config.get_bool( 'enable_beta_job_managers', False ):
from galaxy.jobs import transfer_manager
-1
View File
@@ -227,7 +227,6 @@ class Configuration( object ):
self.external_chown_script = kwargs.get('external_chown_script', None)
self.environment_setup_file = kwargs.get( 'environment_setup_file', None )
self.use_heartbeat = string_as_bool( kwargs.get( 'use_heartbeat', 'False' ) )
self.use_memdump = string_as_bool( kwargs.get( 'use_memdump', 'False' ) )
self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) )
self.log_events = string_as_bool( kwargs.get( 'log_events', 'False' ) )
self.sanitize_all_html = string_as_bool( kwargs.get( 'sanitize_all_html', True ) )
-2
View File
@@ -385,8 +385,6 @@ class GalaxyConfig( object ):
"DRMAA_python": lambda: "sge" in self.config.get( "app:main", "start_job_runners" ).split(","),
"drmaa": lambda: "drmaa" in self.config.get( "app:main", "start_job_runners" ).split(","),
"pbs_python": lambda: "pbs" in self.config.get( "app:main", "start_job_runners" ).split(","),
"threadframe": lambda: self.config.get( "app:main", "use_heartbeat" ),
"guppy": lambda: self.config.get( "app:main", "use_memdump" ),
"python_openid": lambda: self.config.get( "app:main", "enable_openid" ),
"python_daemon": lambda: sys.version_info[:2] >= ( 2, 5 ),
"pysam": lambda: check_pysam(),
-50
View File
@@ -1,50 +0,0 @@
# Attempt to load guppy module, and only define Memdump class
# if available
try:
import pkg_resources
pkg_resources.require( "guppy" )
except:
import sys
print >> sys.stderr, "No guppy module, Memdump not available"
Memdump = None
else:
import os, sys, signal, time, guppy
class Memdump( object ):
def __init__( self, signum=signal.SIGUSR1, fname="memdump.log" ):
self.fname = fname
signal.signal( signum, self.dump )
self.heapy = guppy.hpy()
self.heap = None
def dump( self, signum, stack ):
file = open( self.fname, "a" )
print >> file, "Memdump for pid %d at %s" % ( os.getpid(), time.asctime() )
print >> file
try:
self.heap = self.heapy.heap()
print >> file, "heap():"
print >> file, self.heap
print >> file, "\nbyrcs:"
print >> file, self.heap.byrcs
print >> file, "\nbyrcs[0].byid:"
print >> file, self.heap.byrcs[0].byid
print >> file, "\nget_rp():"
print >> file, self.heap.get_rp()
self.heapy.setref()
except AssertionError:
pass
print >> file, "\nEnd dump\n"
file.close()
def setref( self ):
self.heapy.setref()
def get( self, update=False ):
if update:
self.heap = self.heapy.heap()
return self.heap
-42
View File
@@ -1024,48 +1024,6 @@ class Admin( object ):
message=message,
status=status )
@web.expose
@web.require_admin
def memdump( self, trans, ids = 'None', sorts = 'None', pages = 'None', new_id = None, new_sort = None, **kwd ):
if self.app.memdump is None:
return trans.show_error_message( "Memdump is not enabled (set <code>use_memdump = True</code> in galaxy.ini)" )
heap = self.app.memdump.get()
p = util.Params( kwd )
msg = None
if p.dump:
heap = self.app.memdump.get( update = True )
msg = "Heap dump complete"
elif p.setref:
self.app.memdump.setref()
msg = "Reference point set (dump to see delta from this point)"
ids = ids.split( ',' )
sorts = sorts.split( ',' )
if new_id is not None:
ids.append( new_id )
sorts.append( 'None' )
elif new_sort is not None:
sorts[-1] = new_sort
breadcrumb = "<a href='%s' class='breadcrumb'>heap</a>" % web.url_for(controller='admin', action='memdump')
# new lists so we can assemble breadcrumb links
new_ids = []
new_sorts = []
for id, sort in zip( ids, sorts ):
new_ids.append( id )
if id != 'None':
breadcrumb += "<a href='%s' class='breadcrumb'>[%s]</a>" % ( web.url_for(controller='admin', action='memdump', ids=','.join( new_ids ), sorts=','.join( new_sorts ) ), id )
heap = heap[int(id)]
new_sorts.append( sort )
if sort != 'None':
breadcrumb += "<a href='%s' class='breadcrumb'>.by('%s')</a>" % ( web.url_for(controller='admin', action='memdump', ids=','.join( new_ids ), sorts=','.join( new_sorts ) ), sort )
heap = heap.by( sort )
ids = ','.join( new_ids )
sorts = ','.join( new_sorts )
if p.theone:
breadcrumb += ".theone"
heap = heap.theone
return trans.fill_template( '/admin/memdump.mako', heap = heap, ids = ids, sorts = sorts, breadcrumb = breadcrumb, msg = msg )
@web.expose
@web.require_admin
def jobs( self, trans, stop = [], stop_msg = None, cutoff = 180, job_lock = None, ajl_submit = None, **kwd ):
-76
View File
@@ -1,76 +0,0 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%def name="title()">Memory Profiling</%def>
<%
import re
from xml.sax.saxutils import escape, unescape
%>
<style type="text/css">
a.breadcrumb:link,
a.breadcrumb:visited,
a.breadcrumb:active {
text-decoration: none;
}
a.breadcrumb:hover {
text-decoration: underline;
}
</style>
<h2>Memory Profiling</h2>
<ul class="manage-table-actions">
<li><a class="action-button" href="${h.url_for( controller='admin', action='memdump', dump=True )}">Dump memory (warning: hangs server!)</a></li>
<li><a class="action-button" href="${h.url_for( controller='admin', action='memdump', setref=True )}">Set reference point</a></li>
</ul>
<%def name="htmlize( heap )">
<%
s = escape( str( heap ) )
new_s = ""
id_re = re.compile('^(\s+)([0-9]+)')
for line in s.split( '\n' ):
try:
id = id_re.search( line ).group( 2 )
except:
id = None
new_s += re.sub( id_re, r'\1<a href="' + h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_id=id ) + r'">\2</a>', line )
if id and heap[int(id)].count == 1:
new_s += " <a href='%s'>theone</a>\n" % h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_id=id, theone=True )
else:
new_s += "\n"
return new_s
%>
</%def>
%if message:
${render_msg( message, status )}
%endif
%if heap is None:
No memory dump available. Click "Dump memory" to create one.
%else:
<pre>
<br/>
You are here: ${breadcrumb}<br/>
%if breadcrumb.endswith( 'theone' ):
${heap|h}
%else:
<nobr>
Sort:
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Class')}">Class</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Clodo' )}">Clodo</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Id' )}">Id</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Idset' )}">Idset</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Module' )}">Module</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Unity' )}">Unity</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Rcs' )}">Rcs</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Size' )}">Size</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Type' )}">Type</a> |
<a href="${h.url_for( controller='admin', action='memdump', ids=ids, sorts=sorts, new_sort='Via' )}">Via</a>
</nobr>
${htmlize( heap )}
%endif
</pre>
%endif
@@ -78,7 +78,6 @@
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='tool_versions' )}" target="galaxy_main">View tool lineage</a></div>
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='package_tool' )}" target="galaxy_main">Download tool tarball</a></div>
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='reload_tool' )}" target="galaxy_main">Reload a tool's configuration</a></div>
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='memdump' )}" target="galaxy_main">Profile memory usage</a></div>
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='jobs' )}" target="galaxy_main">Manage jobs</a></div>
<div class="toolTitle"><a href="${h.url_for( controller='admin', action='review_tool_migration_stages' )}" target="galaxy_main">Review tool migration stages</a></div>
%if installing_repository_ids: