databasescientific-notationrrdtoolrrddatabase-dump

How do RRD values in a database dump translate to the input values?


I am having trouble understanding the values that I have saved in my Round Robin Database. I do a dump with rrdtool dump mydatabase and I get a dump of the data. I found the most recent update, and matched it to my rrd update command:

$rrdupdate --template=var1:var2:var3:var4:var5 N:15834740:839964:247212:156320:13493356

In my dump at the matching timestamp, I find these values:

<!-- 2016-12-01 10:30:00 CST / 1480609800 --> <row><v>9.0950245287e+04</v><v>4.8264158237e+03</v><v>1.4182428703e+03</v><v>8.9785764359e+02</v><v>7.7501969607e+04</v></row>

The first value is supposed to be var1. Out of scientific notation, that's 90,950.245287, which does not match up at all to my input value. (None of them are decimal.)

Is there something special I have to do to be able to convert values from my dump to get the standard value that I entered?


Solution

  • I can't give you specifics for your case, as you have not shown the full definition of your RRD file (internals, DS definition, etc), however...

    Values stored in an RRDTool database are subject to Data Normalisation, and are then converted to Rates (unless the DS is of type Gauge in which case they are assumed to be rates already).

    Normalisation is when the values are adjusted on a linear basis to make them fit exactly into the time sequence as defined by the Interval (which is often 300 seconds).

    If you want to see the values stored exactly as you write them, you need to set the DS type to 'gauge', and make Normalisation a null step. The only way to do the latter is to store the values exactly on a time boundary. So, if the Interval is 300s, then store at 12:00:00, 12:05:00, and so on - otherwise the values will be adjusted.

    There is a lot more information about Normalisation - what it is, and why it is done - in Alex van den Bogaerdt's tutorial