Belle II Software  release-08-01-10
PyProfilingModule Class Reference
Inheritance diagram for PyProfilingModule:
Collaboration diagram for PyProfilingModule:

Public Member Functions

def __init__ (self, module, output_file_name=None)
 
def initialize (self)
 
def event (self)
 
def terminate (self)
 
def wrapper_name (self)
 
def param (self)
 
def available_params (self)
 
def compose_wrapped_module_name (self, module)
 
def get_name (self)
 
def beginRun (self)
 
def endRun (self)
 

Public Attributes

 output_file_name
 The output file name the results will be written into.
 
 profiler
 The used profiler instance.
 
 module
 The wrapped module.
 

Static Public Attributes

string default_output_file_name = "profile.txt"
 The default name for output if none is given.
 

Detailed Description

Wrapper module that evaluates the computational performance of python modules.

Uses cProfile.

Attributes:
  module (basf2.Module): The wrapped module that should be profiled.
    Should be a module written in Python, since the profile interacts
    with the interpretor for the measurements, but cannot look into c++ implementations.

  output_file_name (str, optional): Path to the file where the profiling information
    shall be stored. Defaults to profile.txt.

  profiler (cProfile.Profile): Profiler instance to manage and extract the profiling statistics.

Definition at line 113 of file metamodules.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  module,
  output_file_name = None 
)
Create a new PyProfilingModule wrapped around the given module
   which outputs its results to the output_file_name of given (if not, to profile.txt).

Definition at line 133 of file metamodules.py.

Member Function Documentation

◆ available_params()

def available_params (   self)
inherited
Forwards the avaiilable parameters

Definition at line 79 of file metamodules.py.

◆ beginRun()

def beginRun (   self)
inherited
Begin run method of the module

Definition at line 96 of file metamodules.py.

◆ compose_wrapped_module_name()

def compose_wrapped_module_name (   self,
  module 
)
inherited
Compose a name that indicates the wrapped module.

Definition at line 83 of file metamodules.py.

◆ endRun()

def endRun (   self)
inherited
End run method of the module

Definition at line 104 of file metamodules.py.

◆ event()

def event (   self)
Event method of the module

Reimplemented from WrapperModule.

Definition at line 150 of file metamodules.py.

◆ get_name()

def get_name (   self)
inherited
Forwards the name().

Definition at line 88 of file metamodules.py.

◆ initialize()

def initialize (   self)
Initialize method of the module

Reimplemented from WrapperModule.

Definition at line 144 of file metamodules.py.

◆ param()

def param (   self)
inherited
Forwards the parameters

Definition at line 74 of file metamodules.py.

◆ terminate()

def terminate (   self)
Terminate method of the module

Reimplemented from WrapperModule.

Definition at line 157 of file metamodules.py.

◆ wrapper_name()

def wrapper_name (   self)
inherited
Name of the wrapper class.

Definition at line 69 of file metamodules.py.


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