Add failed count

This commit is contained in:
Stéphane Bidoul 2021-11-28 15:27:34 +01:00
parent 0700a21a26
commit af7fb32a5e
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92
2 changed files with 5 additions and 0 deletions

View file

@ -20,6 +20,7 @@ router = APIRouter()
class Status(BaseModel): class Status(BaseModel):
deployed: int deployed: int
max_deployed: int max_deployed: int
failed: int
stopped: int stopped: int
started: int started: int
max_started: int max_started: int

View file

@ -52,6 +52,10 @@ class Controller:
def stopped(self) -> int: def stopped(self) -> int:
return self.db.count_by_status(BuildStatus.stopped) return self.db.count_by_status(BuildStatus.stopped)
@property
def failed(self) -> int:
return self.db.count_by_status(BuildStatus.failed)
@property @property
def started(self) -> int: def started(self) -> int:
return self.db.count_by_status(BuildStatus.started) return self.db.count_by_status(BuildStatus.started)