Skip to content
Snippets Groups Projects
Unverified Commit ad3c6035 authored by Mathieu Othacehe's avatar Mathieu Othacehe
Browse files

metrics: Fix db-average-eval-duration-per-spec.

* src/cuirass/metrics.scm (db-average-eval-duration-per-spec): Order results
by descending rowid and adjust docstring.
parent c5a97586
No related branches found
No related tags found
No related merge requests found
......@@ -54,12 +54,14 @@
;;;
(define* (db-average-eval-duration-per-spec spec #:key limit)
"Return the evaluation duration of EVAL."
"Return the average evaluation duration for SPEC. Limit the average
computation to the most recent LIMIT records if this argument is set."
(with-db-worker-thread db
(let ((rows (sqlite-exec db "SELECT AVG(duration) FROM
(SELECT (evaltime - timestamp) as duration
FROM Evaluations WHERE specification = " spec
" AND evaltime != 0 LIMIT " (or limit -1) ");")))
" AND evaltime != 0 ORDER BY rowid DESC
LIMIT " (or limit -1) ");")))
(and=> (expect-one-row rows) (cut vector-ref <> 0)))))
(define (db-builds-previous-day _)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment