salvus.flow.acta.observability.progress
salvus.flow.acta.observability.progress salvus flow acta observability progress Live and recorded task progress from ledger events.
Terminals display a redrawn task tree; other streams get one line per event. Redraws are rate limited, and rendering failures warn once.
Functions
attempt_views()
attempt_views()def attempt_views(events: Sequence[Event]) -> list[AttemptView]: ...Fold a run’s events into one view per attempt, in first-seen order.
eventsSequence[Event] — The run’s events, inseqorder.
depths()
depths()def depths(attempts: Sequence[AttemptView]) -> list[int]: ...Return each attempt’s nesting depth, from the parent edge.
attemptsSequence[AttemptView] — The attempts, in first-seen order.
render_run()
render_run()def render_run(run: Run, events: Sequence[Event]) -> str: ...Render one run’s attempts as an indented tree.
Each attempt displays its last recorded status, including unfinished runs.
runRun — The run to render.eventsSequence[Event] — Its events, inseqorder.
render_runs()
render_runs()def render_runs(runs: Sequence[Run]) -> str: ...Render a run listing.
runsSequence[Run] — The runs to render, newest first.
render_tree()
render_tree()def render_tree(
attempts: Sequence[AttemptView], show_detail: bool = True
) -> str: ...Render attempts as an indented tree.
attemptsSequence[AttemptView] — The attempts, in first-seen order.show_detailbool =True— Whether to print the first line of a failure’s detail beneath it.
Classes
AttemptView
AttemptViewclass AttemptView(builtins.object):
def __init__(
self,
task: str,
key: str | None,
parent_key: str | None,
status: EventKind,
detail: str,
started_at: str,
updated_at: str,
) -> None: ...Task-attempt status derived from its events.
taskstr — The task name.keystr | None — Its envelope key, once known.parent_keystr | None — The key of the task that called it, orNoneat the top level.statusEventKind — The last kind recorded for it.detailstr — Last event’s detail, or an empty string.started_atstr — ISO-8601 stamp of its first event.updated_atstr — ISO-8601 stamp of its last.
elapsed_seconds float
elapsed_seconds floatReturn how long this attempt has been running, in seconds.
ProgressView
ProgressViewclass ProgressView(builtins.object):
def __init__(
self, stream: TextIO, clock: Callable[[], float] = time.monotonic
) -> None: ...A tree of the current run’s attempts, redrawn as events arrive.
streamTextIO — Where to draw. A stream whoseisatty()is false gets one plain line per event instead of a redraw.clockCallable[[], float] =time.monotonic— Callable returning monotonic seconds for redraw rate limiting.
attempts()
attempts()def attempts(self) -> list[AttemptView]: ...Return the run’s attempts so far, folded from its events.
close()
close()def close(self) -> None: ...Draw the final state without rate limiting.
handle()
handle()def handle(self, event: Event) -> None: ...Accept one event and redraw, subject to the rate limit.
eventEvent — The event as written to the ledger.
render()
render()def render(self) -> str: ...Return the tree as it currently stands.