Krikri::ProfileTasks
Emulation of the ansible.posix.profile_tasks aggregate callback
(byte-shaped against ansible-core 2.19.11 + ansible.posix 2.1.0,
live-verified): a timestamp line under every TASK / RUNNING HANDLER
banner - <weekday> <day> <month> <year> <HH:MM:SS> <tz-offset> (<previous task's wall clock>) <running total> ****** - and a
TASKS RECAP block after PLAY RECAP listing every tracked task sorted
slowest first.
The real callback's own shape source (profile_tasks.py):
filled(msg):msg + " "then*padding out to 80 columns TOTAL, then one trailing space; the timestamp line is therefore always exactly 80 columns wide regardless of the tty width (the79in filled() is a literal, notDisplay.columns).tasktime(): the parenthesized duration is the time elapsed since the PREVIOUS tasktime call (i.e. the previous task's wall clock, connection overhead included), the unpadded value is the running total since the module was imported (playbook start), separated by exactly seven spaces beforefilledadds its own.- Duration format
H:MM:SS.mmm- hours are NOT zero-padded. - Timestamp format
"%A %d %B %Y %H:%M:%S %z"- two spaces between the year and the clock, English weekday/month names. - TASKS RECAP:
Display.banner("TASKS RECAP")(blank line + 80-wide banner), a tasktime line of its own, a full-width=rule, then one row per tracked task:namepadded with dashes toDisplay.columns - 9andX.XXsright-aligned in 9 columns with dashes, sorted by elapsed duration descending (stable - ties keep first-seen order), capped at 20 rows (the callback's defaulttask_output_limit). - Handlers appear in the recap under their own names (live-verified), and looped tasks are one row total (one task, one entry).
Deliberately not implemented (see KNOWN_MISSING.md): the callback's
own config surface (PROFILE_TASKS_TASK_OUTPUT_LIMIT,
PROFILE_TASKS_SORT_ORDER, PROFILE_TASKS_SUMMARY_ONLY) and the -vv+
per-row task path: line.
Constants
Synthetic identity for the implicit Gathering Facts task - it is not a Task object in this engine, but it still gets its own recap row (live-verified).
The real callback's default task_output_limit.
Class methods
The TASKS RECAP block, printed once after PLAY RECAP (from the CLI
entrypoint's recap site). Emits its own banner lines directly
rather than through OutputBanner.banner: under the oneline stdout
callback the regular banners are suppressed, but the real
profile_tasks callback still prints its own TASKS RECAP banner
(live-verified: oneline + profile_tasks together).
One tracked task start: prints the timestamp line (under the banner
the caller has just printed - the caller owns banner placement, so
PLAY/PLAY RECAP banners stay unaffected), closes out the previous
task's duration, and opens the new one. Called once per task (not
per host), keyed by the Task object itself so serial: re-runs of
the same task accumulate into one row, matching the real callback's
per-UUID stats dict.