cars.orchestrator.cluster.log_wrapper

Contains functions for wrapper logs

Module Contents

Classes

AbstractLogWrapper

AbstractLogWrapper

LogWrapper

LogWrapper

CProfileWrapper

CProfileWrapper

MemrayWrapper

MemrayWrapper

Functions

log_function(*argv, **kwargs)

Create a wrapper for function running it

time_profiling_function(*argv, **kwargs)

Create a wrapper to profile the function elapse time

memory_profiling_function(*argv, **kwargs)

Create a wrapper to profile the function occupation memory

switch_messages(func, total_time)

create profile message with specific message

log_message(func, message)

log profiling message

loop_function(argv, kwargs, func[, nb_iteration])

generate a loop on each cluster function to eval possible leak

class cars.orchestrator.cluster.log_wrapper.AbstractLogWrapper(func)

AbstractLogWrapper

abstract func_args_plus()

getter for the args of the future function

Returns

function to apply, overloaded key arguments

class cars.orchestrator.cluster.log_wrapper.LogWrapper(func, loop_testing)

Bases: AbstractLogWrapper

LogWrapper

simple log wrapper to eval the function elapsed time

func_args_plus()

getter for the args of the future function

Returns

function to apply, overloaded key arguments

class cars.orchestrator.cluster.log_wrapper.CProfileWrapper(func)

Bases: AbstractLogWrapper

CProfileWrapper

log wrapper to analyze the internal time consuming of the function. The wrapper use cprofile API.

func_args_plus()

getter for the args of the future function

Returns

function to apply, overloaded key arguments

class cars.orchestrator.cluster.log_wrapper.MemrayWrapper(func, loop_testing, out_dir)

Bases: AbstractLogWrapper

MemrayWrapper

log wrapper to analyze the internal allocation memory consuming of the function. The wrapper use cprofile API.

func_args_plus()

getter for the args of the future function

Returns

function to apply, overloaded key arguments

cars.orchestrator.cluster.log_wrapper.log_function(*argv, **kwargs)

Create a wrapper for function running it

Parameters
  • argv – args of func

  • kwargs – kwargs of func

Returns

path to results

cars.orchestrator.cluster.log_wrapper.time_profiling_function(*argv, **kwargs)

Create a wrapper to profile the function elapse time

Parameters
  • argv – args of func

  • kwargs – kwargs of func

Returns

path to results

cars.orchestrator.cluster.log_wrapper.memory_profiling_function(*argv, **kwargs)

Create a wrapper to profile the function occupation memory

Parameters
  • argv – args of func

  • kwargs – kwargs of func

Returns

path to results

cars.orchestrator.cluster.log_wrapper.switch_messages(func, total_time)

create profile message with specific message depends on elapsed time (LONG, FAST…).

:param func : profiled function :param total_time : elapsed time of the function

cars.orchestrator.cluster.log_wrapper.log_message(func, message)

log profiling message

:param func : logged function :param message : log message

cars.orchestrator.cluster.log_wrapper.loop_function(argv, kwargs, func, nb_iteration=5)

generate a loop on each cluster function to eval possible leak

:param argv : input argv :param kwargs : input kwargs :param func : function to evaluation :param nb_iteration (int, optional): number of the iteration loop. :param Defaults to 5.

Returns:

_type_: result of the function