add building to general stats

This commit is contained in:
2025-04-20 17:30:30 +02:00
parent d5f24feb9e
commit 7ab90d4af6
2 changed files with 8 additions and 0 deletions

3
api.go
View File

@@ -19,6 +19,7 @@ type StatsResponse struct {
Skipped int `json:"skipped"` Skipped int `json:"skipped"`
Latest int `json:"latest"` Latest int `json:"latest"`
Queued int `json:"queued"` Queued int `json:"queued"`
Building int `json:"building"`
LastMirrorTimestamp *int64 `json:"last_mirror_timestamp,omitempty"` LastMirrorTimestamp *int64 `json:"last_mirror_timestamp,omitempty"`
LTO *struct { LTO *struct {
Enabled int `json:"enabled"` Enabled int `json:"enabled"`
@@ -73,6 +74,8 @@ func GetStats(w http.ResponseWriter, r *http.Request) {
resp.Latest = c.Count resp.Latest = c.Count
case dbpackage.StatusQueued: case dbpackage.StatusQueued:
resp.Queued = c.Count resp.Queued = c.Count
case dbpackage.StatusBuilding:
resp.Building = c.Count
} }
} }

View File

@@ -224,6 +224,11 @@ components:
format: int64 format: int64
description: Number of packages currently in the build queue description: Number of packages currently in the build queue
example: 5 example: 5
building:
type: integer
format: int64
description: Number of packages currently building
example: 11
last_mirror_timestamp: last_mirror_timestamp:
type: integer type: integer
format: int64 format: int64