Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.util.thread_monitor.DirectMonitor Class Reference
Inheritance diagram for MoinMoin.util.thread_monitor.DirectMonitor:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.util.thread_monitor.DirectMonitor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def activate_hook
def trigger_dump
def hook_enabled

Public Attributes

 enabled

Detailed Description

Definition at line 93 of file thread_monitor.py.


Constructor & Destructor Documentation

Definition at line 94 of file thread_monitor.py.

00094 
00095     def __init__(self):
00096         self.enabled = False
00097         assert hasattr(sys, "_current_frames")


Member Function Documentation

Activates the thread monitor hook. Note that this might interfere
with any kind of profiler and some debugging extensions. 

Reimplemented from MoinMoin.util.thread_monitor.AbstractMonitor.

Definition at line 98 of file thread_monitor.py.

00098 
00099     def activate_hook(self):
00100         self.enabled = True

Returns true if the thread_monitor hook is enabled. 

Reimplemented from MoinMoin.util.thread_monitor.AbstractMonitor.

Definition at line 112 of file thread_monitor.py.

00112 
00113     def hook_enabled(self):
00114         return self.enabled
00115 

def MoinMoin.util.thread_monitor.DirectMonitor.trigger_dump (   self,
  dumpfile = None 
)
Triggers the dump of the tracebacks of all threads.
    If dumpfile is specified, it is used as the output file. 

Reimplemented from MoinMoin.util.thread_monitor.AbstractMonitor.

Definition at line 101 of file thread_monitor.py.

00101 
00102     def trigger_dump(self, dumpfile=None):
00103         if not self.enabled:
00104             return
00105         dumpfile = dumpfile or sys.stderr
00106         cur_frames = sys._current_frames()
00107         for i in cur_frames:
00108             s = StringIO()
00109             print >>s, "\nDumping thread (id %s):" % (i, )
00110             traceback.print_stack(cur_frames[i], file=s)
00111             dumpfile.write(s.getvalue())


Member Data Documentation

Definition at line 95 of file thread_monitor.py.


The documentation for this class was generated from the following file: