From 281ed4a99d1cf0eb950cd8224e6b249a3d6705f3 Mon Sep 17 00:00:00 2001 From: bmc-msft <41130664+bmc-msft@users.noreply.github.com> Date: Tue, 24 Aug 2021 13:04:50 -0400 Subject: [PATCH] display VM Count for tasks (#1169) Co-authored-by: Brian Caswell --- src/cli/onefuzz/status/cache.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/onefuzz/status/cache.py b/src/cli/onefuzz/status/cache.py index a9b677443b..2f9a75d0c8 100644 --- a/src/cli/onefuzz/status/cache.py +++ b/src/cli/onefuzz/status/cache.py @@ -71,6 +71,7 @@ class MiniTask(BaseModel): pool: str end_time: Optional[datetime] containers: List[TaskContainers] + vm_count: int def fmt(data: Any) -> Any: @@ -118,6 +119,7 @@ class TopCache: "Target", "Files", "Pool", + "VM Count", "End time", ] POOL_FIELDS = ["Name", "OS", "Arch", "Nodes"] @@ -289,6 +291,7 @@ def add_task(self, task: Task) -> None: target=(task.config.task.target_exe or "").replace("setup/", "", 0), containers=task.config.containers, end_time=task.end_time, + vm_count=task.config.pool.count if task.config.pool else 0, ) def task_created(self, event: EventTaskCreated) -> None: @@ -300,6 +303,7 @@ def task_created(self, event: EventTaskCreated) -> None: target=(event.config.task.target_exe or "").replace("setup/", "", 0), containers=event.config.containers, state=TaskState.init, + vm_count=event.config.pool.count if event.config.pool else 0, ) def task_state_updated(self, event: EventTaskStateUpdated) -> None: @@ -335,6 +339,7 @@ def render_tasks(self) -> List: task.target, files, task.pool, + task.vm_count, task.end_time, ) results.append(entry)