Reduce interval to 25min, as it is published every 45min
This commit is contained in:
14
main.go
14
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()
|
||||
|
||||
Reference in New Issue
Block a user