From fa6ebe4ba54934579a2f2f58de6697d3b250c3e6 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Tue, 24 Mar 2026 20:56:52 +0100 Subject: [PATCH] Reduce interval to 25min, as it is published every 45min --- main.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index f69464a..f3c1512 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,6 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" ) - type exporter struct { mu sync.RWMutex uptime *prometheus.GaugeVec @@ -60,7 +59,10 @@ func (e *exporter) fetch(csvURL string) error { } // collect new values before updating metrics - type row struct{ logURL, endpoint string; ratio float64 } + type row struct { + logURL, endpoint string + ratio float64 + } var rows []row for { rec, err := r.Read() @@ -113,10 +115,10 @@ func (e *exporter) run(csvURL string, interval, jitter time.Duration) { } func main() { - addr := flag.String("listen", ":9781", "address to listen on") - csvURL := flag.String("url", "https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv", "URL of the uptime CSV") - interval := flag.Duration("interval", 12*time.Hour, "how often to fetch the CSV") - jitter := flag.Duration("jitter", 5*time.Minute, "maximum +/-jitter applied to the fetch interval") + addr := flag.String("listen", ":9781", "address to listen on") + csvURL := flag.String("url", "https://www.gstatic.com/ct/compliance/endpoint_uptime_24h.csv", "URL of the uptime CSV") + interval := flag.Duration("interval", 25*time.Minute, "how often to fetch the CSV") + jitter := flag.Duration("jitter", 5*time.Minute, "maximum +/-jitter applied to the fetch interval") flag.Parse() reg := prometheus.NewRegistry()