[rrd-users] RRA of unaltered data
simon at thehobsons.co.uk
Wed Nov 25 11:36:01 CET 2015
Thomas Nilsson <thomas.nilsson at ltu.se> wrote:
> 1. Is there a way to get the values I add to show up unaltered in the RRA?
> Tried with LAST, AVERAGE, MIN and MAX in the RRA declaration.
> 2. How are the values in my RRA calculated?
These together must be one of the most frequently asked questions, to which there is a simple answer :
In particular, "Rates, normalizing and consolidating" http://rrdtool.vandenbogaerdt.nl/process.php
The latter will answer question 2. Once you understand that, then you'll understand the answer to question 1 which is: ensure that the normalisation process is a "null operation". That means you must supply data on *exactly* step boundaries, for every step, only once per step, and missing no steps out.
So in your example, you must ensure that the timestamp of every update is on *exactly* a multiple of 5 seconds since unix epoch - not "now", not "a 5 second sleep plus the execution time of a few statements after the previous one", but on exactly a multiple of 5 seconds.
Thus (in bash) you can do :
t=$( ( $t / $s ) * $s )
rrdtool update ... $t:$v
This will ensure that the values stored will be exactly what you put in - but only until there is some consolidation.
But in general, if you want to store exact values, and especially if they are produced at irregular times, then RRD is probably not the right tool.
More information about the rrd-users