-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stats
min
is always 0
#31
Comments
Also, to be clear, my fixes are somewhat independent of the issue here. I think a better fix to the underlying issue in this ticket is to actually track whether or not we've added a first value at all. If we have not seen any values in a distribution at all, The proposed solution of using |
#35 has been merged (and released), leaving open so that we don't forget to apply the fix outlined in @thoughtpolice's comment. |
I still have this problem: min and max are always being reported as 0.0 for a distribution. |
The problem still exists, looks like the min and max values are always zero. This can easily be tested out with the following snippet: {-# language OverloadedStrings #-}
module EkgTest where
import System.Metrics
import System.Metrics.Distribution as Distribution
main :: IO ()
main = do
s <- newStore
d <- createDistribution "foo" s
Distribution.add d 3
Distribution.read d >>= print
The output is:
As you can notice the |
A new
Distribution
zeros outcMin
. https://github.com/tibbe/ekg-core/blob/master/System/Metrics/Distribution.hsc#L99AFAICT it will aways be zero if the input is positive: https://github.com/tibbe/ekg-core/blob/master/cbits/distrib.c#L24
I think
cMin
would be more useful it was initialized to the largestDouble
. Then it would show the smallest value seen if a single data point was added.The text was updated successfully, but these errors were encountered: