hpcflow.sdk.log.TimeIt#

class hpcflow.sdk.log.TimeIt#

Bases: object

Method execution time instrumentation.

Methods

decorator

Decorator for a method that is to have its execution time monitored.

summarise_string

Produce a human-readable summary of method execution time statistics.

Attributes

active

Whether the instrumentation is active.

file_path

Where to log to.

timers

The details be tracked.

trace

Traces of the stack.

trace_idx

Trace indices.

trace_idx_prev

Preceding trace indices.

trace_prev

Preceding traces.

active: ClassVar = False#

Whether the instrumentation is active.

classmethod decorator(func)#

Decorator for a method that is to have its execution time monitored.

Parameters:

func (Callable[[~P], T]) –

Return type:

Callable[[~P], T]

file_path: ClassVar[str | None] = None#

Where to log to.

classmethod summarise_string()#

Produce a human-readable summary of method execution time statistics.

Return type:

None

timers: ClassVar[dict[tuple[str, ...], list[float]]] = {}#

The details be tracked.

trace: ClassVar[list[str]] = []#

Traces of the stack.

trace_idx: ClassVar[list[int]] = []#

Trace indices.

trace_idx_prev: ClassVar[list[int]] = []#

Preceding trace indices.

trace_prev: ClassVar[list[str]] = []#

Preceding traces.