feat(backend/jobs): add agent_id parameter
ci-agent / build (push) Failing after 5m40s

This commit is contained in:
2026-04-05 04:14:38 +03:00
parent 8226429b5b
commit b1e6775f1b
5 changed files with 34 additions and 12 deletions
+3 -1
View File
@@ -230,6 +230,7 @@ type JobMetricsOut struct {
// @Tags jobs
// @Produce json
// @Param period query string false "Time period (e.g. 1h, 24h, 7d)" default(24h)
// @Param agent_id query string false "Filter by agent ID"
// @Success 200 {object} JobMetricsOut
// @Failure 400 {object} map[string]string
// @Security Bearer
@@ -242,8 +243,9 @@ func (h *JobsHandlers) GetJobMetrics(c *gin.Context) {
return
}
agentID := c.Query("agent_id")
since := time.Now().Add(-period)
metrics, err := h.jobRepo.GetJobMetrics(c.Request.Context(), since)
metrics, err := h.jobRepo.GetJobMetrics(c.Request.Context(), since, agentID)
if err != nil {
c.Error(err)
return