Skip to content

ProfileUtilAustin

implementation of the profile utilities for the Austin profiler

MySimpleAustin

Canonical path: TestHelper.ProfileUtilAustin.MySimpleAustin

Bases: SimpleAustin

implementation of the simple Austin class

__init__

__init__(
    austin_running_event: Event,
    test_running_event: Event,
    terminate_event: Event,
    process_id: str,
    result_file_name: str,
)

initialize

Parameters:

  • austin_running_event (Event) –

    signals the running austin

  • test_running_event (Event) –

    signals the running test

  • terminate_event (Event) –

    signals the profile termination

  • process_id (str) –

    process ID of the profess to profile

  • result_file_name (str) –

    name of the result file

on_ready

on_ready(
    _process: Any, _child_process: Any, _command_line: str, _data: Any = None
) -> Any

function description

Parameters:

  • _process (Any) –

    process

  • _child_process (Any) –

    child process

  • _command_line (str) –

    command line

  • _data (Any, default: None ) –

    data

on_sample_received

on_sample_received(text: str)

receive the sample result

Parameters:

  • text (str) –

    sample result

on_terminate

on_terminate(_stats: Dict[str, str])

terminate the profiling

Parameters:

  • _stats (Dict[str, str]) –

    stats

austin_process

austin_process(
    austin_running_event: Event,
    test_running_event: Event,
    terminate_event: Event,
    finish_event: Event,
    process_id: str,
    result_file_name: str,
)

start the Austin process

Parameters:

  • austin_running_event (Event) –

    signals the running austin

  • test_running_event (Event) –

    signals the running test

  • terminate_event (Event) –

    signals the profile termination

  • finish_event (Event) –

    signals the profile thread finish

  • process_id (str) –

    process id to profile

  • result_file_name (str) –

    name of the result file

profile_by_austin

profile_by_austin(result_file_name: str, function: Callable, *param: List[Any])

profile by Austin profiler

Parameters:

  • result_file_name (str) –

    name of the result file

  • function (Callable) –

    function to execute

  • *param (List[Any], default: () ) –

    function parameter