Package hotshot :: Class Profile
[hide private]
[frames] | no frames]

_ClassType Profile

Instance Methods [hide private]
 
__init__(self, logfn, lineevents=0, linetimings=1)
 
close(self)
Close the logfile and terminate the profiler.
 
fileno(self)
Return the file descriptor of the profiler's log file.
 
start(self)
Start the profiler.
 
stop(self)
Stop the profiler.
 
addinfo(self, key, value)
Add an arbitrary labelled value to the profile log.
 
run(self, cmd)
Profile an exec-compatible string in the script environment.
 
runctx(self, cmd, globals, locals)
Evaluate an exec-compatible string in a specific environment.
 
runcall(self, func, *args, **kw)
Profile a single call of a callable.
Method Details [hide private]

run(self, cmd)

 

Profile an exec-compatible string in the script environment.

The globals from the __main__ module are used as both the globals and locals for the script.

runctx(self, cmd, globals, locals)

 

Evaluate an exec-compatible string in a specific environment.

The string is compiled before profiling begins.

runcall(self, func, *args, **kw)

 

Profile a single call of a callable.

Additional positional and keyword arguments may be passed along; the result of the call is returned, and exceptions are allowed to propogate cleanly, while ensuring that profiling is disabled on the way out.