dasf.profile.profiler

Attributes

EventTypes

event_classes

Classes

EventPhases

InstantEventScope

InstantEvent

CompleteEvent

DurationBeginEvent

DurationEndEvent

EventDatabase

Helper class that provides a standard way to create an ABC using

FileDatabase

Helper class that provides a standard way to create an ABC using

EventProfiler

Module Contents

class dasf.profile.profiler.EventPhases[source]
COMPLETE = 'X'
DURATION_BEGIN = 'B'
DURATION_END = 'E'
INSTANT = 'I'
ASYNC_BEGIN = 'b'
ASYNC_INSTANT = 'n'
ASYNC_END = 'e'
FLOW_BEGIN = 's'
FLOW_STEP = 't'
FLOW_END = 'f'
COUNTER = 'C'
OBJECT_CREATED = 'N'
OBJECT_SNAPSHOT = 'O'
OBJECT_DESTROYED = 'D'
METADATA = 'M'
MARK = 'R'
class dasf.profile.profiler.InstantEventScope[source]
GLOBAL = 'g'
PROCESS = 'p'
THREAD = 't'
class dasf.profile.profiler.InstantEvent[source]
name: str
timestamp: float
phase: str
scope: str
process_id: int = 0
thread_id: int = 0
args: dict
class dasf.profile.profiler.CompleteEvent[source]
name: str
timestamp: float
duration: float
phase: str
process_id: int = 0
thread_id: int = 0
args: dict
class dasf.profile.profiler.DurationBeginEvent[source]
name: str
timestamp: float
phase: str
process_id: int = 0
thread_id: int = 0
args: dict
class dasf.profile.profiler.DurationEndEvent[source]
name: str
timestamp: float
phase: str
process_id: int = 0
thread_id: int = 0
args: dict
dasf.profile.profiler.EventTypes
dasf.profile.profiler.event_classes
class dasf.profile.profiler.EventDatabase[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

open()[source]
Return type:

EventDatabase

abstract record(event)[source]
Parameters:

event (EventTypes)

abstract commit()[source]
abstract get_traces()[source]
Return type:

Iterable[EventTypes]

close()[source]
__enter__()[source]
__exit__(*args, **kwargs)[source]
class dasf.profile.profiler.FileDatabase(database_file='traces.msgpack', commit_threshold=5000, remove_old_output_file=False, commit_on_close=True, lock_timeout=30, default_byte_size=8, flush=True)[source]

Bases: EventDatabase

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:
  • database_file (str)

  • commit_threshold (int)

  • remove_old_output_file (bool)

  • commit_on_close (bool)

  • lock_timeout (int)

  • default_byte_size (int)

  • flush (bool)

database_file
commit_threshold
commit_on_close
queue
lock_timeout
byte_size
flush
record(event)[source]
Parameters:

event (EventTypes)

commit()[source]
get_traces()[source]
Return type:

Iterable[EventTypes]

close()[source]
__str__()[source]
Return type:

str

__repr__()[source]
Return type:

str

class dasf.profile.profiler.EventProfiler(database_file=None, database_creation_kwargs=None, database=None)[source]
Parameters:
  • database_file (str)

  • database_creation_kwargs (dict)

  • database (EventDatabase)

traces_file_prefix = 'traces-'
default_database
default_database_kwargs
output_file = None
_record(event)[source]
Parameters:

event (EventTypes)

record_complete_event(name, timestamp, duration, **kwargs)[source]
Parameters:
  • name (str)

  • timestamp (float)

  • duration (float)

record_instant_event(name, timestamp, **kwargs)[source]
Parameters:
  • name (str)

  • timestamp (float)

record_duration_begin_event(name, timestamp, **kwargs)[source]
Parameters:
  • name (str)

  • timestamp (float)

record_duration_end_event(name, timestamp, **kwargs)[source]
Parameters:
  • name (str)

  • timestamp (float)

get_traces()[source]
Return type:

Iterable[EventTypes]

__str__()[source]
__repr__()[source]
Return type:

str

commit()[source]