[rrd-users] Re: Help with spikes

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Thu Mar 9 00:37:01 MET 2000


Tobias Oetiker wrote:
> 
> *> RRDtool can work with counters that go up to 2^64-1.  This is
> *> 18,446,744,073,709,551,615  erm, well, a lot.
> 
> This is not correct ... rrdtool can work with counters of up to 30
> digits this is ~ 2^99 which should be fine for the time being ... 

Okay, let me rephrase this:

RRDtool can handle counter wraps at 2^64.

>From the current source, file rrd_update.c:

   if(dst_idx == DST_COUNTER) {
      /* simple overflow catcher sugestet by andres kroonmaa */
      /* this will fail terribly for non 32 or 64 bit counters ... */
      /* are there any others in SNMP land ? */
      if (pdp_new[i] < (double)0.0 )
        pdp_new[i] += (double)4294967296.0 ;  /* 2^32 */
        if (pdp_new[i] < (double)0.0 )
        pdp_new[i] += (double)18446744069414584320.0; /* 2^64-2^32 */;
   }

So: if the delta is negative, add 2^32.  If it is still negative, add
the difference of 2^64 and 2^32 (effectively adding 2^64 to the original
delta).

This means that you can get a delta near 2^64-2^32 which is about
18,446,744,069,414,584,320 without anything failing (apart from a
missing MAX setting).  This is 18446 Petabyte.

I could be wrong on this but I did re-re-re-reread above mail :-)
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users



More information about the rrd-users mailing list