From 296c284ccb90151c1b2ec1c9b93a5b9b56d2f4c1 Mon Sep 17 00:00:00 2001 From: Yghor Kerscher Date: Fri, 17 Nov 2017 18:45:06 +0100 Subject: [PATCH 1/2] Update Stackage snapshot --- stack.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stack.yaml b/stack.yaml index 201b8b0..6a0e360 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-8.12 +resolver: lts-9.13 packages: - . - location: @@ -7,8 +7,8 @@ packages: extra-dep: true - location: git: https://github.com/commercialhaskell/all-cabal-metadata-tool - commit: 1a4d8cff4e796ea0049537a38e38ec0a739caf64 + commit: ea541be73238a5ce14ad26f4e2a94e63981242a4 extra-dep: true extra-deps: -- aws-0.16 - barrier-0.1.1 +- spoon-0.3.1 From d7789b438081fdadb8551095ac2458d67d5574f5 Mon Sep 17 00:00:00 2001 From: Yghor Kerscher Date: Fri, 17 Nov 2017 18:45:46 +0100 Subject: [PATCH 2/2] 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