PolyGenius
Contents

visualize$execution$performance

visualize execution performance as ggplot figures

Renders the execution dashboard's performance charts as live ggplot2 objects from one execution's <exec_id>.jsonl event stream. These are the same themed figures the dashboard embeds, returned to R so they can be restyled, composed, and saved with ggplot2::ggsave().

Usage

visualize.execution.performance(
  execution = NULL,
  metric = NULL,
  by = "time",
  flip = FALSE,
  color = "resource"
)

Arguments

ArgumentDescription
executionA run result object, a character scalar, or NULL (default). Which execution to plot: NULL takes the most recent stream in the workspace execution directory; a run result object (e.g. the PGSLibrary returned by generate$models()) is resolved through its provenance; a character scalar is an execution id (e.g. "20260627-204722-0001"), a path to a .jsonl stream, or a directory holding one or more streams (the most recent is used). Aborts when no stream resolves, and when the resolved stream holds no completed task.
metricOne of "occupancy" (core usage against the allocated pool), "concurrency" (running-task parallelism), "packing" (task bin-packing over the pool), "memfootprint", "throughput", "queue", "completions", "walltime", "peakmem", "corecost", or NULL (default). NULL returns every chart that has data, and makes by, flip and color inert.
byOne of "time" (default), over elapsed run time, or "rule", aggregated per rule. Aborts when the metric has no view for it.
flipLogical scalar, default FALSE. TRUE flips the axes to horizontal rules; read only when by = "rule".
colorOne of "resource" (default), the resource computed, or "rule", the pipeline rule. Tints the task rectangles; read only when metric = "packing".

Value

With metric = NULL, a named list of ggplot objects keyed by the dashboard's export id ("walltime-rule", "concurrency-time", ...) in .pg.perf.builders() order; a chart with no data is omitted, so the list may be empty. With metric set, one ggplot, or an abort when that chart has no data. Each element composes with + like any other ggplot; the list itself does not.

Details

The reducer reads whatever the stream holds at call time, so a still-running execution yields a partial picture rather than an error. Not every metric/by pair exists -- occupancy, packing, throughput and queue depth are run-global and have only a "time" view; asking for another names the views that do exist.

Examples

models <- generate$models(sources = sources, algorithms = algorithms)
plots <- visualize$execution$performance(models)
names(plots)
visualize$execution$performance(models, metric = "walltime", by = "rule")

See Also

visualize$execution$dashboard, which embeds these same charts in a self-contained HTML page.

Other visualize-execution: visualize.execution.dashboard()

Aliases: visualize.execution.performance, visualize$execution$performance, visualize_execution_performance