8000 fix(api): metrics on jobs (#3273) · ovh/cds@fd3b4f2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit fd3b4f2

Browse files
authored
fix(api): metrics on jobs (#3273)
1 parent a4075ba commit fd3b4f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

engine/api/metrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func Initialize(c context.Context, DBFunc func() *gorp.DbMap, instance string) {
6969
count(DBFunc(), nbWorkflowRuns, "SELECT MAX(id) FROM workflow_run")
7070
count(DBFunc(), nbWorkflowNodeRuns, "SELECT MAX(id) FROM workflow_node_run")
7171
count(DBFunc(), nbMaxWorkersBuilding, "SELECT COUNT(1) FROM worker where status = 'Building'")
72-
count(DBFunc(), nbJobs, "SELECT MAX(id) FROM workflow_node_run_job_info")
72+
count(DBFunc(), nbJobs, "SELECT COUNT(1) FROM (SELECT distinct(workflow_node_run_job_id) from workflow_node_run_job_info group by workflow_node_run_job_id) AS temp")
7373

7474
now := time.Now()
7575
now10s := now. 3801 Add(-10 * time.Second)

0 commit comments

Comments
 (0)
0