Skip to content

jobs

jobs

Job-centric process tree panel for the Marianne Monitor TUI.

Renders a tree of jobs with their sheets and running processes, including inline metrics (CPU, MEM, age) and syscall summaries.

Jobs are collapsible — collapsed by default when many jobs exist, expandable on click or Enter to reveal the process tree.

Classes

JobsPanel

JobsPanel(*, name=None, id=None, classes=None)

Bases: VerticalScroll

Renders the job tree with per-process metrics in a scrollable container.

Jobs are displayed as collapsible tree nodes. When there are many jobs, they start collapsed; with few jobs, they start expanded.

Source code in src/marianne/tui/panels/jobs.py
def __init__(
    self,
    *,
    name: str | None = None,
    id: str | None = None,
    classes: str | None = None,
) -> None:
    super().__init__(name=name, id=id, classes=classes)
    self._snapshot: SystemSnapshot | None = None
    self._selected_index: int = 0
    self._items: list[dict[str, Any]] = []
    self._tree: Tree[dict[str, Any]] | None = None
    self._empty_label: Static | None = None
    self._observer_file_events: list[dict[str, Any]] = []
    self._sort_key: str = "job_id"
    self._filter_query: str = ""
    self._fleet_data: list[dict[str, Any]] = []
Attributes
selected_item property
selected_item

Return the currently selected item, if any.

Functions
compose
compose()

Build the widget tree with a Tree for collapsible jobs.

Source code in src/marianne/tui/panels/jobs.py
def compose(self) -> Any:
    """Build the widget tree with a Tree for collapsible jobs."""
    self._empty_label = Static("[dim]No active jobs[/]", id="jobs-empty")
    yield self._empty_label
    tree: Tree[dict[str, Any]] = Tree("Jobs", id="jobs-tree")
    tree.show_root = False
    tree.guide_depth = 3
    self._tree = tree
    yield tree
select_next
select_next()

Move selection down in the tree.

Source code in src/marianne/tui/panels/jobs.py
def select_next(self) -> None:
    """Move selection down in the tree."""
    if self._tree is not None:
        self._tree.action_cursor_down()
    if self._items:
        self._selected_index = min(
            self._selected_index + 1, len(self._items) - 1
        )
select_prev
select_prev()

Move selection up in the tree.

Source code in src/marianne/tui/panels/jobs.py
def select_prev(self) -> None:
    """Move selection up in the tree."""
    if self._tree is not None:
        self._tree.action_cursor_up()
    if self._items:
        self._selected_index = max(self._selected_index - 1, 0)
update_data
update_data(snapshot, observer_file_events=None, fleet_data=None)

Update the panel with new snapshot data.

Parameters:

Name Type Description Default
snapshot SystemSnapshot | None

Current system snapshot with process metrics.

required
observer_file_events list[dict[str, Any]] | None

Observer file events for job correlation.

None
fleet_data list[dict[str, Any]] | None

Fleet status dicts from fleet manager. Each dict has fleet_id, name, members (list of {job_id, group, status}).

None
Source code in src/marianne/tui/panels/jobs.py
def update_data(
    self,
    snapshot: SystemSnapshot | None,
    observer_file_events: list[dict[str, Any]] | None = None,
    fleet_data: list[dict[str, Any]] | None = None,
) -> None:
    """Update the panel with new snapshot data.

    Args:
        snapshot: Current system snapshot with process metrics.
        observer_file_events: Observer file events for job correlation.
        fleet_data: Fleet status dicts from fleet manager. Each dict has
            fleet_id, name, members (list of {job_id, group, status}).
    """
    self._snapshot = snapshot
    if observer_file_events is not None:
        self._observer_file_events = observer_file_events
    if fleet_data is not None:
        self._fleet_data = fleet_data
    self._render_jobs()