pandora.profiler ================ .. py:module:: pandora.profiler .. autoapi-nested-parse:: Contains functions for wrapper logs Attributes ---------- .. autoapisummary:: pandora.profiler._HAS_PLOTLY_PSUTIL Classes ------- .. autoapisummary:: pandora.profiler.Profiler pandora.profiler.MemProf Functions --------- .. autoapisummary:: pandora.profiler.profile Module Contents --------------- .. py:data:: _HAS_PLOTLY_PSUTIL :value: True .. py:class:: Profiler Main profiler class for Pandora .. py:attribute:: enabled :value: False .. py:attribute:: save_graphs :value: False .. py:attribute:: save_raw_data :value: False .. py:attribute:: _profiling_info .. py:attribute:: running_processes :value: [] .. py:method:: enable_from_config(conf: dict) :staticmethod: Enables the profiler if specified in the config file :param conf: The configuration dict :type conf: dict .. py:method:: add_profiling_info(info: dict) :staticmethod: Add profiling info to the profiling DataFrame. :param info: dictionary with profiling data keys :type info: dict .. py:method:: generate_summary(base_output: str) :staticmethod: Generate Profiling summary :param base_output: Pandora's output directory :type base_output: str .. py:method:: plot_trace_for_call(call_uuid, data_name) :staticmethod: Plot memory (or any resource tracked) usage over time for a function call, with markers for its subcalls. :param call_uuid: UUID of the parent function call :type call_uuid: str :param data_name: The name of the data to plot (if cpu consumption were to be added for example) :type data_name: str :return: The generated plotly figure :rtype: plotly.graph_objs._figure.Figure .. py:function:: profile(name, interval=0.05, memprof=False) Pandora profiling decorator :param name: name of the function in the report :type name: str :param interval: memory sampling interval (seconds) :type interval: int or float :param memprof: whether to profile the memory consumption :type memprof: bool .. py:class:: MemProf(pid, pipe, interval) Bases: :py:obj:`threading.Thread` MemProf Profiling thread .. py:attribute:: pipe .. py:attribute:: interval .. py:attribute:: process .. py:attribute:: mem_data :value: [] .. py:method:: run() Run the memory profiling thread