[rrd-users] [rrd] Can't I turn off data smoothing for GAUGE?

Simon Hobson linux at thehobsons.co.uk
Thu Aug 19 09:05:58 CEST 2010


At 22:49 -0700 18/8/10, Philip Peake wrote:
>Here is what I don't understand:
>
><http://oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html>http://oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html
>GAUGE does not save the rate of change. It saves the actual value 
>itself. There are no divisions or calculations.

That is correct, as far as it goes, in the context it is said. 
However, that section is dealing with input data handling - ie 
conversion from the numbers you put in, to numbers going to storage. 
Other data types are converted to rates - ie (x-y)/t

What happens internally is a 'black box' to me, all I know is that I 
use gauge values a lot for logging temperature, and I get out what I 
put in (after normalisation and consolidation).

I agree it is misleading by not pointing out that the value will 
still be normalised and consolidated just like everything else.

>Looking at the source:
>
>             case DST_GAUGE:
>                 old_locale = setlocale(LC_NUMERIC, "C");
>                 errno = 0;
>                 pdp_new[ds_idx] =
>                     strtod(updvals[ds_idx + 1], &endptr) * interval;
>                 if (errno) {
>                     rrd_set_error("converting '%s' to float: %s",
>                                   updvals[ds_idx + 1], rrd_strerror(errno));
>                     return -1;
>                 };
>                 setlocale(LC_NUMERIC, old_locale);
>                 if (endptr[0] != '\0') {
>                     rrd_set_error
>                         ("conversion of '%s' to float not complete: 
>tail '%s'",
>                          updvals[ds_idx + 1], endptr);
>                     return -1;
>                 }
>                 rate = pdp_new[ds_idx] / interval;
>                 break;
>
>If this line is removed, it will behave as documented.
>I can not really see any point in this, a gauge is a gauge, its not a rate.

No it won't - except under special circumstances that you can use 
anyway. If you do not feed in an update **exactly** on every step 
boundary then normalisation will occur - as per the tutorial I 
previously posted a link to, you have read it I assume ? This is how 
rrd works, it would require massive changes to make it work otherwise.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the rrd-users mailing list