flytekitplugins.memray
class memray_profiling(
task_function: typing.Optional[typing.Callable] = None,
native_traces: bool = False,
trace_python_allocators: bool = False,
follow_fork: bool = False,
memory_interval_ms: int = 10,
memray_html_reporter: str = 'flamegraph',
memray_reporter_args: typing.Optional[typing.List[str]] = None,
)
Memray profiling plugin.
| Parameter |
Type |
Description |
task_function |
typing.Optional[typing.Callable] |
The user function to be decorated. Defaults to None. |
native_traces |
bool |
Whether or not to capture native stack frames, in addition to Python stack frames (see
Native tracking) |
trace_python_allocators |
bool |
Whether or not to trace Python allocators as independent allocations. (see
Python allocators) |
follow_fork |
bool |
Whether or not to continue tracking in a subprocess that is forked from the tracked process (see
Tracking across forks) |
memory_interval_ms |
int |
How many milliseconds to wait between sending periodic resident set size updates. By default, every 10 milliseconds a record is written that contains the current timestamp and the total number of bytes of virtual memory allocated by the process. These records are used to create the graph of memory usage over time that appears at the top of the flame graph, for instance. This parameter lets you adjust the frequency between updates, though you shouldn’t need to change it. |
memray_html_reporter |
str |
The name of the memray reporter which generates an html report. Today there is only ‘flamegraph’ & ’table’. |
memray_reporter_args |
typing.Optional[typing.List[str]] |
A list of arguments to pass to the reporter commands. See the
flamegraph and
table docs for details on supported arguments. |
def execute(
*args,
**kwargs,
)
This method will be called when the decorated function is called.
| Parameter |
Type |
Description |
*args |
|
|
**kwargs |
|
|
def generate_flytedeck_html(
reporter,
bin_filepath,
)
| Parameter |
Type |
Description |
reporter |
|
|
bin_filepath |
|
|
Get the config of the decorator.