From d7de795a9f8895543aa1e7f2ce3886aff0b24b76 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Mon, 13 Sep 2021 23:29:35 -0400 Subject: [PATCH] Retrieve metrics from the past 2 hours for badges with a duration of 1h --- controller/handler/badge.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/handler/badge.go b/controller/handler/badge.go index 570f070f..02ad64b3 100644 --- a/controller/handler/badge.go +++ b/controller/handler/badge.go @@ -34,7 +34,7 @@ func UptimeBadge(writer http.ResponseWriter, request *http.Request) { case "24h": from = time.Now().Add(-24 * time.Hour) case "1h": - from = time.Now().Add(-time.Hour) + from = time.Now().Add(-2 * time.Hour) // Because uptime metrics are stored by hour, we have to cheat a little default: http.Error(writer, "Durations supported: 7d, 24h, 1h", http.StatusBadRequest) return @@ -73,7 +73,7 @@ func ResponseTimeBadge(writer http.ResponseWriter, request *http.Request) { case "24h": from = time.Now().Add(-24 * time.Hour) case "1h": - from = time.Now().Add(-time.Hour) + from = time.Now().Add(-2 * time.Hour) // Because response time metrics are stored by hour, we have to cheat a little default: http.Error(writer, "Durations supported: 7d, 24h, 1h", http.StatusBadRequest) return