guix-commits
[Top][All Lists]
Advanced

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

02/03: Add a metric for the number of revisions


From: Christopher Baines
Subject: 02/03: Add a metric for the number of revisions
Date: Sun, 20 Sep 2020 14:14:11 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit fd3ba489d986d4f348c675cd63b1abd191f1aa86
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Sep 20 18:39:46 2020 +0100

    Add a metric for the number of revisions
---
 guix-data-service/web/controller.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix-data-service/web/controller.scm 
b/guix-data-service/web/controller.scm
index 863805f..44d57c1 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -85,6 +85,10 @@
 (define render-metrics
   (let* ((registry                  (make-metrics-registry
                                      #:namespace "guixdataservice"))
+
+         (revisions-count-metric    (make-gauge-metric registry
+                                                       "revision_count"))
+
          (table-row-estimate-metric (make-gauge-metric registry
                                                        "table_row_estimate"
                                                        #:labels '(name)))
@@ -116,6 +120,9 @@
                                  #:label-values `((name . ,name)))))
                   metric-values))
 
+      (metric-set revisions-count-metric
+                  (count-guix-revisions conn))
+
       (list (build-response
              #:code 200
              #:headers '((content-type . (text/plain))))



reply via email to

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