[collectd] fix to create RRDs correctly
octo at verplant.org
Mon Feb 18 20:23:11 CET 2008
On Fri, Feb 15, 2008 at 05:40:14PM -0800, Thorsten von Eicken wrote:
> When creating an RRD file, the rrdtool plugin doesn't do what it's
> supposed to do. Instead of creating 5 RRAs it creates 4 and in doing
> so it skips the first one. The result is about 2x the number of
> datapoints total.
the first RRA always has a stepsize of one, i. e. no consolidation and
the maximum resolution. If a `timespan' is too short, e. g. with a ten
second interval and a timespan of 3600 seconds, the first RRA would only
have 360 datapoints, but per default 1200 are demanded.
In this case the
if ((span / ss) < rrarows)
is performed. The next timespan, e. g. 86400 seconds, results in 8640
Later RRAs then switch to another logic: They chose the smallest number
of consolidated datapoints so that `timespan / stepsize >= rrarows'.
That's the `ceil' call a bit further down.
But I think I see the problem here: The logic requires that the
timespans are sorted in an ascending order. With the `RRATimespan'
option this is not enforced. Thus specifying the timespans in another
order breaks that logic.
So I think the right fix for this would be to add a call to `qsort(3)'
to the function handling the configuration. I'll provide a patch for
this in a minute..
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080218/64642fca/attachment.pgp
More information about the collectd