lib_profiling module

Routines for profiling and generation of call graphs (using pycallgrah).

lib_profiling.get_include_functions(input_py, avoid_v=['main'], plus_v=['lib_*'], exclude_v=['*.<module>'], profile_memory=0)[source]

Get str with include argument for pycallgraph.

input_py : str
python script to scan functions in.
avoid_v : list of str
list of funcionts to be excluded.
profile_memory : int
[0 by default] if 1 will include memory profiling information (see notes below).
i_args : str
arguments on functions to be included in pycallgraph profiling.
-Memory profiling (not used by default):
Reported as experimental by pycallgrpah docs. Install psutil and python-psutil, otherwise it will be slow.
lib_profiling.get_pycallgraph_str(i_args, out_png)[source]

Get caller to pycallgraph.

i_args : str
generated wit get_include_functions().
out_png : str
output image (.png).
pycallgraph_str : str
caller.
lib_profiling.process_cprof_file(file_cprof)[source]

Convert cProfile output file into text format, see Script section below for an usage example.