From d7789b438081fdadb8551095ac2458d67d5574f5 Mon Sep 17 00:00:00 2001 From: Yghor Kerscher Date: Fri, 17 Nov 2017 18:45:46 +0100 Subject: [PATCH] Change metric type to Histogram, from Summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This provides the ability to aggregate results in Prometheus, allowing metrics such as “average time per handler executed”. Summaries do not provide this facility, and since their use-case for other views on Prometheus is similar on `stackage-server`’s use-cases, it has been completely changed to Histograms. --- Import.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Import.hs b/Import.hs index f897b78..ede6d54 100644 --- a/Import.hs +++ b/Import.hs @@ -52,16 +52,16 @@ track name inner = do return result where {-# NOINLINE duration #-} - duration :: P.Metric (P.Vector P.Label1 P.Summary) + duration :: P.Metric (P.Vector P.Label1 P.Histogram) duration = P.unsafeRegisterIO (P.vector "fn" - (P.summary + (P.histogram (P.Info "stackage_server_fn" "Stackage Server function call (duration in microseconds).") - P.defaultQuantiles)) + P.defaultBuckets)) dateDiff :: UTCTime -- ^ now -> Day -- ^ target