Add builds per machine metric table.

This commit is contained in:
Mathieu Othacehe 2021-03-23 09:47:08 +01:00
parent f6008378be
commit 48f630f9f7
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
3 changed files with 22 additions and 0 deletions

View File

@ -274,6 +274,9 @@ Hydra format."
#:builds-per-day
(db-get-metrics-with-id 'builds-per-day
#:limit 100)
#:builds-per-machine
(db-get-metrics-with-id 'builds-per-machine-per-day
#:order "field ASC")
#:eval-completion-speed
(db-get-metrics-with-id 'evaluation-completion-speed
#:limit 100

View File

@ -308,6 +308,7 @@ to_timestamp(stoptime)::date > 'today'::date - interval '1 day'"))))
;; Builds count per machine during the last day.
(metric
(id 'builds-per-machine-per-day)
(field-type 'string)
(compute-proc db-builds-count-per-machine))))
(define (metric->type metric)

View File

@ -1314,6 +1314,7 @@ window.~a = new Chart\
avg-eval-durations
avg-eval-build-start-time
builds-per-day
builds-per-machine
eval-completion-speed
new-derivations-per-day
pending-builds
@ -1337,6 +1338,14 @@ window.~a = new Chart\
"%"))
(map cdr percentages)))))
(define (builds-per-machine-rows builds)
(map (match-lambda
((field . value)
`(tr (td ,field)
(td ,(number->string
(nearest-exact-integer value))))))
builds))
(define (builds->json-scm builds)
(apply vector
(map (match-lambda
@ -1394,6 +1403,15 @@ completed builds divided by the time required to build them.")
(br)
(canvas (@ (id ,pending-builds-chart)))
(br)
(h6 "Builds per machine.")
(p "This is the builds count per machine during the last day.")
(table
(@ (class "table table-sm table-hover table-striped"))
(thead (tr (th (@ (scope "col")) "Machine")
(th (@ (scope "col")) "Builds (last 24 hours)")))
(tbody
,(builds-per-machine-rows builds-per-machine)))
(br)
(h6 "Percentage of failed evaluations.")
(table
(@ (class "table table-sm table-hover table-striped"))