Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
display VM Count for tasks (#1169)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Caswell <bmc@shmoo.com>
  • Loading branch information
bmc-msft and demoray authored Aug 24, 2021
1 parent cbd6de9 commit 281ed4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cli/onefuzz/status/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class MiniTask(BaseModel):
pool: str
end_time: Optional[datetime]
containers: List[TaskContainers]
vm_count: int


def fmt(data: Any) -> Any:
Expand Down Expand Up @@ -118,6 +119,7 @@ class TopCache:
"Target",
"Files",
"Pool",
"VM Count",
"End time",
]
POOL_FIELDS = ["Name", "OS", "Arch", "Nodes"]
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -335,6 +339,7 @@ def render_tasks(self) -> List:
task.target,
files,
task.pool,
task.vm_count,
task.end_time,
)
results.append(entry)
Expand Down

0 comments on commit 281ed4a

Please sign in to comment.