mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add realtime stats endpoints for masters
Introduce StatsService integration to admin and master handlers, exposing realtime metrics (requests, tokens, QPS, rate limit status) via new endpoints: - GET /admin/masters/:id/realtime - GET /v1/realtime Also embed realtime stats in the existing GET /admin/masters/:id response and change GlobalQPS default to 0 with validation to reject negative values.
This commit is contained in:
@@ -20,7 +20,7 @@ type Master struct {
|
||||
Epoch int64 `gorm:"default:1" json:"epoch"` // used for revocation/rotation
|
||||
Status string `gorm:"size:50;default:'active'" json:"status"` // active, suspended
|
||||
MaxChildKeys int `gorm:"default:5" json:"max_child_keys"`
|
||||
GlobalQPS int `gorm:"default:3" json:"global_qps"`
|
||||
GlobalQPS int `gorm:"default:0" json:"global_qps"`
|
||||
}
|
||||
|
||||
// Key represents a child access token issued by a Master.
|
||||
|
||||
Reference in New Issue
Block a user