collect_task_runtimes#
- lsst.analysis.ap.collect_task_runtimes(butler, collections, threshold=1.0, *, plot=False, ax=None)#
Per-task runtime and memory summary for a butler run collection.
Each
<task>_metadatadataset undercollectionsis loaded and its timing fields extracted withfrom_task_metadata. Tasks whose every quantum runs faster thanthresholdseconds are dropped; tasks with at least one quantum at or abovethresholdcontribute all their quanta to the per-task summary statistics, so the summary reflects cross-quantum variability rather than a single outlier.Parameters#
- butler
lsst.daf.butler.Butler Butler used to query the registry and load metadata datasets.
- collections
stror iterable ofstr Collections to query, typically a single run collection name.
- threshold
float, optional Minimum task duration (seconds) for inclusion. A task is kept iff at least one of its quanta has
total_time>=threshold. Default1.0.- plot
bool, optional If True, render a horizontal box plot of per-quantum
total_timeper surviving task (tasks ordered by maxtotal_timedescending) and return the(df, fig)pair instead of justdf.- ax
matplotlib.axes.Axesor None Axes to plot onto. Only used when
plot=True. If None, a new figure and axes are created.
Returns#
- df
pandas.DataFrame One row per task, with columns:
task: pipeline task labeln_quanta: number of surviving quanta contributing to the rowtotal_time_mean,total_time_min,total_time_max,total_time_std: secondsmemory_mean_<UNIT>,memory_min_<UNIT>,memory_max_<UNIT>,memory_std_<UNIT>: whereUNITisGBif any task’s peak memory crosses 1 GB andMBotherwise. The unit is chosen once across the whole table so the columns remain numerically comparable.
- fig
matplotlib.figure.Figure Only returned when
plot=True.
- butler