Skip to content

aea.helpers.profiling

Implementation of background profiling daemon.

Profiling Objects

class Profiling(Runnable)

Profiling service.

__init__

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

Init profiler.

Arguments:

  • period: delay between profiling output in seconds.
  • output_function: function to display ouput, one str argument.

set_counters

 | set_counters()

Modify obj.new to count objects created created.

run

 | async run() -> None

Run profiling.

output_profile_data

 | output_profile_data() -> None

Render profiling data and call output_function.

get_profile_data

 | get_profile_data() -> Dict

Get profiling data dict.

get_objects_instances

 | get_objects_instances() -> Dict

Return dict with counted object instances present now.

get_objecst_created

 | get_objecst_created() -> Dict

Return dict with counted object instances created.