[rrd-users] PERCENT vs. NaN
Joshua Keroes
joshua at keroes.com
Fri Mar 20 03:24:20 CET 2009
In the docs for the PERCENT function, it says:
*Unknown* values are considered lower than any finite number for this
purpose so if this operator returns an *unknown* you have quite a lot of
them in your data. *Inf*inite numbers are lesser, or more, than the finite
numbers and are always more than the *Unknown* numbers. (NaN < -INF < finite
values < INF)
How does that affect my results? I ask because it appears as if the NaN's
are being factored in the final sorted list. Witness:
webservd at water:/nfs/info/integra.engr/stats/ubi/rrd $ rrdtool graph
/dev/null \
--start=02/20/09 \
--end=03/20/09 \
DEF:i=iahigl415050ubielg.rrd:ingress:MAX \
DEF:e=iahigl415050ubielg.rrd:egress:MAX \
CDEF:max_bits=i,e,MAX,8,* \
VDEF:ptile_bits=max_bits,95,PERCENT \
PRINT:ptile_bits:%.0lf
0x0
43488451
I've exported the data from that time window. There are 8064 lines of data.
7769 of them have values. The final 323 are filled with NaN's. Some are
there because we missed polls. 269 of the NaN's are there at the end of the
export because the end date is in the future.
Here's the funny thing: looking through my exported data, I can find
43488450.8, which is the only number close to 43488451. It's at index 7741.
What percentile is that?
webservd at water:/nfs/info/integra.engr/stats/ubi/rrd $ bc -l
7741/7769
.99639593255245205303
Whoa, whoa, whoa. That doesn't look right. That's the 99.6396th percentile!
That's too far to the end! Hmm. What if we include the NaN's for the final
position?
7741/8064
.95994543650793650793
Well, the 95.9945th percentile is closer to what we want, but it's still not
the 95th percentile (7660 or 7661).
It looks like rrdtool is using the NaN's to calculate the result but it's a
bit off. (95.9945th percentile instead of 95.0th percentile)
I don't understand these results. What's happening here?
-Joshua
PS I've uploaded an RRD dump and the data export for 2/20/09-3/20/09 to
http://keroes.com/rrd/ if you'd like to see for yourself.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20090319/485cf296/attachment-0001.html
More information about the rrd-users
mailing list