Add stopped count to controller status api
This commit is contained in:
parent
b17e639572
commit
256f828e97
2 changed files with 5 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ router = APIRouter()
|
||||||
class Status(BaseModel):
|
class Status(BaseModel):
|
||||||
deployed: int
|
deployed: int
|
||||||
max_deployed: int
|
max_deployed: int
|
||||||
|
stopped: int
|
||||||
started: int
|
started: int
|
||||||
max_started: int
|
max_started: int
|
||||||
to_initialize: int
|
to_initialize: int
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,10 @@ class Controller:
|
||||||
if event == BuildEvent.modified and build.status == BuildStatus.undeploying:
|
if event == BuildEvent.modified and build.status == BuildStatus.undeploying:
|
||||||
self._wakeup_cleaner.set()
|
self._wakeup_cleaner.set()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def stopped(self) -> int:
|
||||||
|
return self.db.count_by_status(BuildStatus.stopped)
|
||||||
|
|
||||||
@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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue