Module _lsprof :: Class Profiler
[hide private]
[frames] | no frames]

type Profiler

object --+
         |
        Profiler
Known Subclasses:

Profiler(custom_timer=None, time_unit=None, subcalls=True, builtins=True)

Builds a profiler object using the specified timer function. The default timer is a fast built-in one based on real time. For custom timer functions returning integers, time_unit can be a float specifying a scale (i.e. how long each integer unit is, in seconds).

Instance Methods [hide private]
 
__init__(custom_timer=None, time_unit=None, subcalls=True, builtins=True)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
clear()
Clear all profiling information collected so far.
 
disable()
Stop collecting profiling information.
 
enable(subcalls=True, builtins=True)
Start collecting profiling information.
list of profiler_entry objects
getstats()
Return all information collected by the profiler.
Method Details [hide private]

__init__(custom_timer=None, time_unit=None, subcalls=True, builtins=True)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

enable(subcalls=True, builtins=True)

 

Start collecting profiling information. If 'subcalls' is True, also records for each function statistics separated according to its current caller. If 'builtins' is True, records the time spent in built-in functions separately from their caller.

getstats()

 
Return all information collected by the profiler.
Each profiler_entry is a tuple-like object with the
following attributes:

    code          code object
    callcount     how many times this was called
    reccallcount  how many times called recursively
    totaltime     total time in this entry
    inlinetime    inline time in this entry (not in subcalls)
    calls         details of the calls

The calls attribute is either None or a list of
profiler_subentry objects:

    code          called code object
    callcount     how many times this is called
    reccallcount  how many times this is called recursively
    totaltime     total time spent in this call
    inlinetime    inline time (not in further subcalls)

Returns: list of profiler_entry objects