Skip to content

Profile Util

Class full path: TestHelper.ProfileUtil.ProfileUtil

Profiler utility class

Functions

__profile_by_cprofile(function, calls_to_print, show_graphical_results, *param) staticmethod

profile by cprofile

Parameters:

Name Type Description Default
function Callable

function to execute

required
calls_to_print int

number of calls shown in the profile report

required
show_graphical_results bool

show graphical results

required
param Any

parameter for the function

()

Returns:

Type Description

return value of the call function

__profile_by_line_profiler(function, *param) staticmethod

profile by line_profiler

Parameters:

Name Type Description Default
function

function to execute

required
param

parameter for the function

()

Returns:

Type Description

return value of the call function

__profile_by_pyinstrument(function, *param) staticmethod

profile by pyinstrument

Parameters:

Name Type Description Default
function

function to execute

required
param

parameter for the function

()

Returns:

Type Description

return value of the call function

profile(function, *param, calls_to_print=20, description='', show_graphical_results=False, profiler_type=C_PROFILE, show_separator_line=False, result_file_name='') staticmethod

profile by cprofile

Parameters:

Name Type Description Default
function Callable

function to execute

required
*param Any

function parameter

()
calls_to_print int

number of calls shown in the profile report (only for C_Profile)

20
description str

description of the text

''
show_graphical_results bool

show graphical results (only for C_Profile)

False
profiler_type ProfilerType

type of the profiler

C_PROFILE
show_separator_line bool

show a separator line before the results

False
result_file_name str

name of the result file

''

Returns:

Type Description
Any

return value of the call function