[rrd-users] How to get MAX/MIN of non-rates?

Tony Mountifield tony at mountifield.org
Wed Apr 3 22:00:23 CEST 2013

In article <04D9B47DE80B8FF249827B72AB248A05 at thehobsons.co.uk>,
Simon Hobson <linux at thehobsons.co.uk> wrote:
> Tony Mountifield wrote:
> >This has shown up another issue which is related to the "everything is a rate"
> >philosophy of RRD. I am using a RRD GAUGE DS to log values which are not rates,
> >but rather instantaneous values (e.g. disk space, channel usage, temperature).
> >
> >Let's say I log a value of 20 at time x. The input data changes to 25 at time
> >y, so I log it at that time. I want the graph to show 20 from time x to time y
> >and 25 from time y onwards.
> >
> >However, RRD is taking those values to be pre-derived *rates since the
> >previous update*. So it is assuming the 25 means the average rate of
> >something between time x and time y. So the graph is always one update
> >adrift of the true change in values.
> No, how can you be sure that the rate didn't change a microsecond after you read it ?

My point is regarding values that are *not* rates.

> >The only way around this that I can think of is to remember the old value,
> >and write it to the immediately preceding time. So in the above example,
> >at time y I would write the old value of 20 to time y-1 and then the new
> >value of 25 to time y.
> Correct

I got this working, and it looks much saner now.

> >Is there any way, in that version or a newer version, to properly handle
> >values that are instantaneous quantities rather than rates, without having
> >to resort to the dual-write kludge I mentioned above?
> The way it's doing it now is not incorrect, just not what you want.

I know it's not incorrect, *iff* the supplied gauge values indicate rates
since the time of the previous value.

I guess my point is that RRD would be enhanced if it was able to store
values that don't indicate rates, but rather the last known value of a
scalar quantity, and the time of that value (implying "until further

> If you
> sample at t=0 and t=10, then you only know the values at t=0 and t=10 -
> you don't know the values at t=1, t=2, ... t=9. At t=10, you only know
> (when using RRD for it's primary task) that the *AVERAGE* between t=0 and
> t=10 was <something>. RRD correctly shows the value stored at t=10 as
> applying between t=0 and t=10, not as predicting the future between t=10
> and t=20.  Gauge values don't change that, they are really just a fudge to
> store numbers in place of rates.

I'm not trying to predict the future, I just want a mode where storing
such a value at t=10 implies that the previous value was valid until t=9,
which would be the case for scalar values rather than rates.

But anyway, at least I have a workaround.

Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

More information about the rrd-users mailing list