roastcoffea.visualization.plots.cpu

CPU utilization plots.

Visualizations for CPU usage and worker task metrics.

Functions

plot_cpu_utilization_mean_timeline(tracking_data)

Plot mean CPU utilization percentage over time with min-max band.

plot_cpu_utilization_per_worker_timeline(...)

Plot CPU utilization percentage per worker over time.

plot_executing_tasks_timeline(tracking_data)

Plot number of executing tasks per worker over time.

plot_occupancy_timeline(tracking_data[, ...])

Plot worker occupancy (task saturation) over time.

roastcoffea.visualization.plots.cpu.plot_occupancy_timeline(tracking_data, output_path=None, figsize=(12, 6), title='Worker Occupancy Over Time', max_legend_entries=5)[source]

Plot worker occupancy (task saturation) over time.

Occupancy is a metric from Dask scheduler indicating how saturated a worker is with tasks. 0.0 = idle, higher values = more saturated.

Parameters:
  • tracking_data (dict or None) – Tracking data with worker_occupancy

  • output_path (Path, optional) – Save path

  • figsize (tuple) – Figure size

  • title (str) – Plot title

  • max_legend_entries (int, optional) – Maximum number of workers to show in legend. Default is 5.

Returns:

fig, ax – Matplotlib figure and axes

Return type:

Figure and Axes

Raises:

ValueError – If tracking_data is None or missing occupancy data

roastcoffea.visualization.plots.cpu.plot_executing_tasks_timeline(tracking_data, output_path=None, figsize=(12, 6), title='Executing Tasks Per Worker Over Time', max_legend_entries=5)[source]

Plot number of executing tasks per worker over time.

Executing tasks are tasks actually running (subset of active tasks).

Parameters:
  • tracking_data (dict or None) – Tracking data with worker_executing

  • output_path (Path, optional) – Save path

  • figsize (tuple) – Figure size

  • title (str) – Plot title

  • max_legend_entries (int, optional) – Maximum number of workers to show in legend. Default is 5.

Returns:

fig, ax – Matplotlib figure and axes

Return type:

Figure and Axes

Raises:

ValueError – If tracking_data is None or missing executing data

roastcoffea.visualization.plots.cpu.plot_cpu_utilization_per_worker_timeline(tracking_data, output_path=None, figsize=(12, 6), title='CPU Utilization Per Worker Over Time', max_legend_entries=5)[source]

Plot CPU utilization percentage per worker over time.

Shows actual CPU usage (0-100%) for each worker, providing insight into compute resource utilization.

Parameters:
  • tracking_data (dict or None) – Tracking data with worker_cpu

  • output_path (Path, optional) – Save path

  • figsize (tuple) – Figure size

  • title (str) – Plot title

  • max_legend_entries (int, optional) – Maximum number of workers to show in legend. Default is 5.

Returns:

fig, ax – Matplotlib figure and axes

Return type:

Figure and Axes

Raises:

ValueError – If tracking_data is None or missing CPU data

roastcoffea.visualization.plots.cpu.plot_cpu_utilization_mean_timeline(tracking_data, output_path=None, figsize=(10, 4), title='CPU Utilization Over Time')[source]

Plot mean CPU utilization percentage over time with min-max band.

Shows aggregated CPU usage across all workers, with mean line and shaded min-max range.

Parameters:
  • tracking_data (dict or None) – Tracking data with worker_cpu

  • output_path (Path, optional) – Save path

  • figsize (tuple) – Figure size

  • title (str) – Plot title

Returns:

fig, ax – Matplotlib figure and axes

Return type:

Figure and Axes

Raises:

ValueError – If tracking_data is None or missing CPU data