# [rrd-users] Re: Data granularity

Tolga Yalcinkaya tolga at allesta.com
Fri Jan 21 00:59:52 MET 2005

```Comments below...

Serge Maandag wrote:
> No, rrdtool normalizes your input. Therefore it really only is useful
> if you enter data in a regular interval.
>
> Say you updated like this:
>
> rrdtool update resp.rrd 1106249073:15
> rrdtool update resp.rrd 1106249083:45
>
> Then after the second update, rrdtool is able to determine the value
> At timestamp 1106249080. It would be:
>
> (45-15) * (1106249080-1106249073)/(1106249083-1106249073)
> = 30 * 7/10 = 21

Ahhh I see...

>
> It is interpolated because you did not update on a N x 10 seconds
> timestamp
>
> In your case the value is unknown, because you have no previous value to
> use for interpolation. You need multiple consecutive values for that.
>

Got it...

>
>>Is there a way to retain the value entered for that step?
>
>
> One solution is to set the heartbeat very high, so multiple rows will be
>
> filled by a single update, but that is not what you want.
>
> What you could try is:
> - update only on N x 10 timestamps. So 1106249083 would become:
>   10 x int(1106249083/10) = 1106249080 or

Hmm... not sure if this will work.  Wouldn't I have the same problem,
since there is going to be only one data point at N x 10 timestamps?

> - before updating, do a "rrdtool last" to get the last time the database
>   was updated. Then for ech step size between now and that last update
> time,
>   update the database with 0.
>

This would skew the averages, since the empty data points are not NaN...

rrdtool create resp.rrd --step 1 \
DS:resp:GAUGE:1:0:U \
RRA:AVERAGE:0.9:1:300
RRA:AVERAGE:0.99999999:5:2880

When I do an update I do it like this:

if (lastUpdate < now - 1) {
rrdtool update resp.rrd \${now - 1}:45
}

rrdtool update resp.rrd \${now}:45

Do you foresee any problems with this approach?

> I still would use the log file solution.
> It's way cleaner.
>

I agree that log file would solve the problem in a way, but it would
also introduce added complexity.  It is more more thing that could break
and I need to watch out.  If I can't solve the problem, I will
definitely try this method.

Thanks,

--
Tolga Yalcinkaya

_________________________________________________________________
WSABI:  A fiery condiment for Apache Axis!   http://www.wsabi.org

--
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://www.ee.ethz.ch/~slist/rrd-users