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"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type exporter struct {
|
type exporter struct {
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
uptime *prometheus.GaugeVec
|
uptime *prometheus.GaugeVec
|
||||||
@@ -60,7 +59,10 @@ func (e *exporter) fetch(csvURL string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// collect new values before updating metrics
|
// 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
|
var rows []row
|
||||||
for {
|
for {
|
||||||
rec, err := r.Read()
|
rec, err := r.Read()
|
||||||
@@ -113,10 +115,10 @@ func (e *exporter) run(csvURL string, interval, jitter time.Duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
addr := flag.String("listen", ":9781", "address to listen on")
|
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")
|
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")
|
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")
|
jitter := flag.Duration("jitter", 5*time.Minute, "maximum +/-jitter applied to the fetch interval")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
reg := prometheus.NewRegistry()
|
reg := prometheus.NewRegistry()
|
||||||
|
|||||||
Reference in New Issue
Block a user