[rrd-users] Re: how to keep one value per day, with Nan for missing days

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Feb 7 02:59:15 MET 2006

On Mon, Feb 06, 2006 at 05:07:55PM -0800, Melissa Hao wrote:
> Hi,
> I would like to create an rrd database with valkes for almost every day.  For example, I would like to have value for 2/3, 2/4, not 2/5, and 2/6.  For skipped days, such as 2/5, I would like Nan to show up in the database/graph.

> Previously I had my heartbeat set to 604800 (7 days).  If 2/5 was skipped, the data for 2/6 would be copied over to 2/5.  I don't want that -- I want 2/5 to stay Nan.

No, you don't want 2/5 to _stay_ NaN (it hasn't even been set to NaN),
you want it to _become_ NaN.  This is an important difference.

You know you should have a value every day.  If there is no value on a
certain day, you still know that you didn't get it.  So, you can still
to an update, using U for Unknown, and using the timestamp for that day.

> Then I changed the heartbeat to 86400 (1 day).  If 2/5 was skipped, after an rrdtool update 2/6 would be Nan in the rrd file, even though I passed in a valid value into rrdtool update.  2/7's value would be stored correctly, but 2/6 value would be lost.

The difference between the updates at 2/4 and 2/6 is more than heartbeat,
so it is not surprising the update is ignored.  And if the heartbeat is
increased, the update is valid for the entire period.  This is documented
behaviour, you should read it one more time and try to understand what
rrdtool will do with this heartbeat value.

Try the intermediate update on 2/5 (with U), I think it will work.  Why?
Because setting a counter to Unknown _is_ an update.  This is completely
different from not updating at all.

But if you are not using GAUGE or ABSOLUTE, you will still get NaN.
Why? Because the computations become:

(current_value - previous_value) / (current_time - previous_time)
(something_known - unknown) / (86400)
(unknown) / (86400)

In such a case (COUNTER or DERIVE), you need both a valid previous
value and a valid current value.

Other issue:  Make sure you understand that a day is not always 24
hours, and that daychange does not always occur at midnight.

Alex van den Bogaerdt

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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list