<div dir="ltr"><br><br>On 27 October 2015 at 03:59, Pablo Chacin <<a href="mailto:pchacin@sensefields.com">pchacin@sensefields.com</a>> wrote:<br>><br>> From the answers by Steve and Donovan, it seams like there's something fundamental I'm not understanding about RRDTools.<br>> Following is the explanation from Wikipedia<br>[...]<br>> My understanding was that when making the consolidation, al the primary data points were available to the Consolidation function. Therefore, it could be possible to calculate the percentile.<br>><br>> However, from what you explain, it looks as RRDTools re-calculates the aggretate point with each arriving primary point. Is that correct?<br><br>Correct. The aggregation of PDP's into CDP's is done incrementally at each input sample.<div><br></div><div>Note that even if this was not the case, calculating meaningful percentile values would require large "steps" values on the corresponding RRA's. To calculate a reasonable 95th percentile requires at least 20 points.</div><div><br></div><div>This thread made me look at the RRD docs again and I discovered it now supports DS's of type COMPUTE. That means it can already support calculating value^2 as another DS, making it possible to do this;</div><div><br></div><div><div>rrdtool create traffic.rrd \</div><div>   --start now --step 1m \</div><div>   DS:rate:COUNTER:2m:0:1000000 \</div><div>   DS:rate2:COMPUTE:rate,rate,*</div><div>   RRA:AVERAGE:0.5:1m:8d \</div><div>   RRA:AVERAGE:0.5:1h:64d \</div><div>   RRA:AVERAGE:0.5:1d:2y \</div><div><br></div><div>and then get an approximate 95 percentile in your graphs by calculating 2*stddev like this;</div><div><br></div><div><div>DEF:rate=/home/rrdtool/data/traffic.rrd:rate:AVERAGE</div><div>DEF:rate2=/home/rrdtool/data/traffic.rrd:rate2:AVERAGE</div><div>CDEF:variance=rate2,rate,rate,*,-</div><div>CDEF:stddev=variance,SQRT</div><div>CDEF:95ptile=stddev,2.0,*</div><div><br></div></div><div>Unfortunately it doesn't look possible to calculate an approx 95 percentile assuming a log-normal distribution, because RRD doesn't seem to have the functions necessary to calculate lognorminv(), at least not easily.</div><div><br></div><div>--<br>Donovan Baarda <<a href="mailto:abo@minkirri.apana.org.au">abo@minkirri.apana.org.au</a>></div></div></div>