Skip to content

aea.helpers.profiling

Implementation of background profiling daemon.

Profiling Objects

class Profiling(Runnable)

Profiling service.

__init__

def __init__(
    types_to_track: List[Type],
    period: int = 0,
    output_function: Callable[[str], None] = lambda x: print(x, flush=True)
) -> None

Init profiler.

Arguments:

  • period: delay between profiling output in seconds.
  • types_to_track: object types to count
  • output_function: function to display output, one str argument.

set_counters

def set_counters() -> None

Modify new and del to count objects created created and destroyed.

run

async def run() -> None

Run profiling.

output_profile_data

def output_profile_data() -> None

Render profiling data and call output_function.

get_profile_data

def get_profile_data() -> Dict

Get profiling data dict.

get_most_common_objects_in_gc

def get_most_common_objects_in_gc(number: int = 15) -> List[Tuple[str, int]]

Get the highest-count objects in the garbage collector.