0

Why values used for updating a rrd are different than the fetches values

I used this for updating: 1353702000:2000

and I got this when I fetch: 1353702000: 1.6666666667e+00

  • Is there a way to get the number a entered?
  • Is there a way to format the timestamp and the numbers?

Details:

I created this database:

rrdtool create datafile.rrd DS:packets:ABSOLUTE:900:0:10000000 RRA:AVERAGE:0.5:1:9600 RRA:AVERAGE:0.5:4:9600 RRA:AVERAGE:0.5:24:6000

I updated the database with this timestamp and value:

rrdtool update datafile.rrd 1353702000:2000

I fetch de database with this

rrdtool fetch datafile.rrd AVERAGE -r 90 -s -1h

and I got this

1353700800: nan
1353701100: nan
1353701400: nan
1353701700: 1.6666666667e+00
1353702000: 1.6666666667e+00
1353702300: 3.3333333333e+00
1353702600: 3.3333333333e+00
1353702900: 6.6666666667e+00
1353703200: nan
1353703500: nan
1353703800: nan
1353704100: nan
1353704400: nan

Thanks

Federico
  • 5,438
  • 5
  • 39
  • 47

2 Answers2

0

use GAUGE as Datastore Type, not ABSOLUTE

appsthatmatter
  • 6,347
  • 3
  • 36
  • 40
0

The reasons you get these values are twofold.

Firstly, you have type 'ABSOLUTE' for the data, which means that it will be divided by the time since the last update to give a per-second rate. If you want the value stored as-is, use type GAUGE. If the value is constantly increasing - such as with an SNMP network interface packet counter - then use COUNTER to get a rate of change.

Secondly, data normalisation. If the samples are not on the interval boundary (IE, timestamp mod 300 = 0 in this case) they will be adjusted to fit the time. To avoid this, submit the samples with timestamps on the interval boundary.

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39