Change metric type to Histogram, from Summary

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.
This commit is contained in:
Yghor Kerscher 2017-11-17 18:45:46 +01:00
parent 296c284ccb
commit d7789b4380

View File

@ -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