oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
1.02k stars 264 forks source link

Vague setup of RRA intervals #768

Open JKammler opened 7 years ago

JKammler commented 7 years ago

Dear Tobi,

I am a fan of rrdtool but now I detected a behaviour which is at least a bit confusing:

  1. Create an rrd file with one datasource, a steptime of 60s, a heartbeat of 600s and two RRA's (1 minute and 5 minutes): rrdtool-1.6.0/bin/rrdtool create test.rrd -b 1486936800 -s 60 DS:Value:GAUGE:600:0:1 RRA:AVERAGE:0.5:1:10 RRA:AVERAGE:0.5:5:10

  2. Insert value 1 at two specified times A. 1486947930 13/02/2017 02:05:30 B. 1486948275 13/02/2017 02:11:15

    rrdtool-1.6.0/bin/rrdtool update test.rrd 1486947930:1 1486948275:1

    The rrd dump shows that the intervals up to 02:11:00 are computed fine as expected:

1 minute archive:
<!-- 2017-02-13 02:05:00 CET / 1486947900 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:06:00 CET / 1486947960 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:07:00 CET / 1486948020 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:08:00 CET / 1486948080 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:09:00 CET / 1486948140 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:11:00 CET / 1486948260 --> <row><v>1.0000000000e+00</v></row>

5 minutes archive:
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>1.0000000000e+00</v></row>
  1. If you insert the first value at 02:05:31 instead of 02:05:30 ALL intervals become invalid: A. 1486947931 13/02/2017 02:05:31 B. 1486948275 13/02/2017 02:11:15

    rrdtool-1.6.0/bin/rrdtool update test.rrd 1486947931:1 1486948275:1

1 minute archive:
<!-- 2017-02-13 02:05:00 CET / 1486947900 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:06:00 CET / 1486947960 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:07:00 CET / 1486948020 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:08:00 CET / 1486948080 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:09:00 CET / 1486948140 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:11:00 CET / 1486948260 --> <row><v>NaN</v></row>

5 minutes archive:
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>NaN</v></row>
  1. If you insert the first value a bit later instead at 02:06:00 the expected intervals up to 02:11:00 get a valid value again: A. 1486947960 13/02/2017 02:06:00 B. 1486948275 13/02/2017 02:11:15

    rrdtool-1.6.0/bin/rrdtool update test.rrd 1486947960:1 1486948275:1

1 minute archive:
<!-- 2017-02-13 02:05:00 CET / 1486947900 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:06:00 CET / 1486947960 --> <row><v>NaN</v></row>
<!-- 2017-02-13 02:07:00 CET / 1486948020 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:08:00 CET / 1486948080 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:09:00 CET / 1486948140 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>1.0000000000e+00</v></row>
<!-- 2017-02-13 02:11:00 CET / 1486948260 --> <row><v>1.0000000000e+00</v></row>

5 minutes archive:
<!-- 2017-02-13 02:10:00 CET / 1486948200 --> <row><v>1.0000000000e+00</v></row>

I think it is not a bug and maybe it has to do with invalid PDP's but the behaviour seems to be a bit undetermined. It is hard to say "Send the data some seconds later and it will work again".

Could you please be so kind and help me to explain it?

Thanks in advance!

Kind Regards

Jens Kammler

oetiker commented 7 years ago

that is definitely a bug ... not quite clear where it is coming from though ... I can reproduce it ...

JKammler commented 7 years ago

Thank you for investigating this issue! Do you think it can be / will be fixed in the next release?

oetiker commented 7 years ago

it certainly can and will but since I have so many pressing (and paying) projects it is a question of time ... I have looked into it for about an hour but have not gotten to the bottom of the issue ...