pandora.profiler

Contains functions for wrapper logs

Attributes

_HAS_PLOTLY_PSUTIL

Classes

Profiler

Main profiler class for Pandora

MemProf

MemProf

Functions

profile(name[, interval, memprof])

Pandora profiling decorator

Module Contents

pandora.profiler._HAS_PLOTLY_PSUTIL = True[source]
class pandora.profiler.Profiler[source]

Main profiler class for Pandora

enabled = False[source]
save_graphs = False[source]
save_raw_data = False[source]
_profiling_info[source]
running_processes = [][source]
static enable_from_config(conf: dict)[source]

Enables the profiler if specified in the config file

Parameters:

conf (dict) – The configuration dict

static add_profiling_info(info: dict)[source]

Add profiling info to the profiling DataFrame.

Parameters:

info (dict) – dictionary with profiling data keys

static generate_summary(base_output: str)[source]

Generate Profiling summary

Parameters:

base_output (str) – Pandora’s output directory

static plot_trace_for_call(call_uuid, data_name)[source]

Plot memory (or any resource tracked) usage over time for a function call, with markers for its subcalls.

Parameters:
  • call_uuid (str) – UUID of the parent function call

  • data_name (str) – The name of the data to plot (if cpu consumption were to be added for example)

Returns:

The generated plotly figure

Return type:

plotly.graph_objs._figure.Figure

pandora.profiler.profile(name, interval=0.05, memprof=False)[source]

Pandora profiling decorator

Parameters:
  • name (str) – name of the function in the report

  • interval (int or float) – memory sampling interval (seconds)

  • memprof (bool) – whether to profile the memory consumption

class pandora.profiler.MemProf(pid, pipe, interval)[source]

Bases: threading.Thread

MemProf

Profiling thread

pipe[source]
interval[source]
process[source]
mem_data = [][source]
run()[source]

Run the memory profiling thread