display VM Count for tasks (#1169)

Co-authored-by: Brian Caswell <bmc@shmoo.com>
This commit is contained in:
bmc-msft
2021-08-24 13:04:50 -04:00
committed by GitHub
parent cbd6de90c6
commit 281ed4a99d

View File

@ -71,6 +71,7 @@ class MiniTask(BaseModel):
pool: str pool: str
end_time: Optional[datetime] end_time: Optional[datetime]
containers: List[TaskContainers] containers: List[TaskContainers]
vm_count: int
def fmt(data: Any) -> Any: def fmt(data: Any) -> Any:
@ -118,6 +119,7 @@ class TopCache:
"Target", "Target",
"Files", "Files",
"Pool", "Pool",
"VM Count",
"End time", "End time",
] ]
POOL_FIELDS = ["Name", "OS", "Arch", "Nodes"] POOL_FIELDS = ["Name", "OS", "Arch", "Nodes"]
@ -289,6 +291,7 @@ class TopCache:
target=(task.config.task.target_exe or "").replace("setup/", "", 0), target=(task.config.task.target_exe or "").replace("setup/", "", 0),
containers=task.config.containers, containers=task.config.containers,
end_time=task.end_time, end_time=task.end_time,
vm_count=task.config.pool.count if task.config.pool else 0,
) )
def task_created(self, event: EventTaskCreated) -> None: def task_created(self, event: EventTaskCreated) -> None:
@ -300,6 +303,7 @@ class TopCache:
target=(event.config.task.target_exe or "").replace("setup/", "", 0), target=(event.config.task.target_exe or "").replace("setup/", "", 0),
containers=event.config.containers, containers=event.config.containers,
state=TaskState.init, state=TaskState.init,
vm_count=event.config.pool.count if event.config.pool else 0,
) )
def task_state_updated(self, event: EventTaskStateUpdated) -> None: def task_state_updated(self, event: EventTaskStateUpdated) -> None:
@ -335,6 +339,7 @@ class TopCache:
task.target, task.target,
files, files,
task.pool, task.pool,
task.vm_count,
task.end_time, task.end_time,
) )
results.append(entry) results.append(entry)