# [rrd-users] Interpolation with the 'LAST' CF

Darren Kelly darren.kelly at shenick.com
Tue Mar 11 12:47:29 MET 2003

```Hi All,

I'm having a problem understanding the LAST CF.
If you run the following commands:
rrdtool create /tmp/deleteme.rrd  \
-b 1000000000      \
-s 300             \
DS:d:GAUGE:600:U:U \
RRA:LAST:0.5:1:10

rrdtool update /tmp/deleteme.rrd  \
1000000190:0       \
1000000490:6       \
1000000800:6

rrdtool fetch  /tmp/deleteme.rrd -s  999999900 -e 1000000500 LAST

You'll get the output:
999999900: nan
1000000200: 3.0000000000e-01
1000000500: 6.0000000000e+00

The question I have is: Why is 0.3 the value for the interval at 1000000200.
Why is the value not 0? The answer I assume is that interpolation is being
done, but WHY is it being done?
In the above example I only gave two data points, a zero and a six. Surely,
the last value for any interval must be a zero, a six or NaN?

If I'm using 'LAST' then, for any given interval, I'm interested in the last
number recorded. Why interpolate multiple data points together? If we get
two data points in the same interval, shouldn't we just discard the earlier
data point? Is that not the very definition of the LAST CF?

While searching this list's archives I found the following from Alex on Mon,
25 Sep 2000
> Subject: [rrd-users] Re: How to save and graph NON-averages
...
> If you need/want to keep the original values:
> use GAUGE and make sure to update on RRDtool boundaries.

Sure enough, when you change the update times above to 1000000200 and
1000000500 the 0.3 value drops away. I assume by aligning the sampling times
with the RRD boundaries interpolation becomes trivial, but what if (as in my
case) you can't control the times for data points?

In summary:
Why does the last value for a given interval get interpolated from multiple
data points?

Darren

______________________________________________________________________
Darren Kelly
Shenick Software Systems
1-2 Windsor Terrace                              Opening Windows of
Dún Laoghaire                                       Opportunity
Co. Dublin
Ireland							Tel:+ 353 1 236 7002

--
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