guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Mathieu Othacehe
Date: Tue, 23 Mar 2021 06:06:44 -0400 (EDT)

branch: master
commit 48f630f9f7a0743473c3088ebbaf2538558b2947
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Mar 23 09:47:08 2021 +0100

    Add builds per machine metric table.
---
 src/cuirass/http.scm      |  3 +++
 src/cuirass/metrics.scm   |  1 +
 src/cuirass/templates.scm | 18 ++++++++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 263c70a..63afc7d 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -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
diff --git a/src/cuirass/metrics.scm b/src/cuirass/metrics.scm
index 5f14dea..3ec189d 100644
--- a/src/cuirass/metrics.scm
+++ b/src/cuirass/metrics.scm
@@ -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)
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 9e8d2b9..ef33466 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]