[rrd-users] Re: Gauge understanding problem or error ?

Christian Volkmann CVolkmann at orga-systems.com
Fri Aug 19 10:38:34 MEST 2005


Hi Alex,

thanks for the explanation. I do not see a proper explanation of the CF "LAST" or "MAX"
at the tutorial which describe a resampling.

Some design I do not understand.

- Why does a GAUGE do a resampling for "MAX" and "LAST".
  For me a maximum in a period should never be calculated down
  to an average.

- Followed up by this design the two pictures created by the script
  look very different.
  The only difference from the recorded values is recorded with
  20 seconds time difference.
  But that should not affect "MAX" nor "LAST".

The resampling/consolidation expected for MAX should be:
  if ( "in time period" && newvalue > "value of time period" )
     "value of time period" = newvalue;

The resampling/consolidation expected for LAST should be:
  if ( "in time period"  )
     "value of time period" = newvalue;

Otherwise the name "MAX" or "LAST" confuse me.

Isn't the "MAX" "80" to be recorded, especially for "MAX" ?

Think about somebody using it to record the maximum temperature.
He has seen "80 degrees" on the thermometer. has recorded it with
rrd, looks at the history and just see 53,3 degrees in his records.

I am freezing a little about this ;-)

Best regards,

Christian

PS: I like rrd very much ! :)

#!/bin/bash

NAME=unexpected
rrdtool create $NAME.rrd --start 1100000200 -s 60 \
        DS:WERT:GAUGE:60:0:100 \
        RRA:MAX:0:1:8

rrdtool update $NAME.rrd 1100000240:0
rrdtool update $NAME.rrd 1100000300:20
rrdtool update $NAME.rrd 1100000360:0
rrdtool update $NAME.rrd 1100000420:0
rrdtool update $NAME.rrd 1100000480:80
rrdtool update $NAME.rrd 1100000540:0

rrdtool graph $NAME.gif --start 1100000200 \
        --end 1100000600 --step 60 -w 200 -h 200 \
        DEF:wert=${NAME}.rrd:WERT:MAX \
        CDEF:anzeige=wert \
        "LINE1:anzeige#00FF00:'unexpected'"

####################################################
NAME=expected
rrdtool create $NAME.rrd --start 1100000200 -s 60 \
        DS:WERT:GAUGE:60:0:100 \
        RRA:MAX:0:1:8

rrdtool update $NAME.rrd 1100000220:20
rrdtool update $NAME.rrd 1100000280:20
rrdtool update $NAME.rrd 1100000340:0
rrdtool update $NAME.rrd 1100000400:0
rrdtool update $NAME.rrd 1100000460:80
rrdtool update $NAME.rrd 1100000520:0

rrdtool graph $NAME.gif --start 1100000200 \
        --end 1100000600 --step 60 -w 200 -h 200 \
        DEF:wert=${NAME}.rrd:WERT:MAX \
        CDEF:anzeige=wert \
        "LINE1:anzeige#00FF00:'expected'"

display expected.gif &
display unexpected.gif &


rrd-users-bounce at list.ee.ethz.ch wrote:
> On Fri, Aug 19, 2005 at 12:11:39AM +0200, Christian Volkmann wrote:
>> Hi Alex,
>>
>> sorry for my confusing mail.I have some temperature values:
>>
>> 12:34:20 20 degrees
>> 12:35:20 30 degrees
>> 12:36:20 40 degrees
>> 12:37:20 30 degrees
>> 12:38:20 20 degrees
>> 12:39:20 0 degrees
>> 12:40:20 0 degrees
>> 12:41:20 80 degrees
>> 12:42:20 0 degrees
>> 12:43:20 20 degrees
>>
>> I defined the database as GAUGE, step 60 seconds and try to record the MAX-values.
>> I expected the graph to show the exact values from above.
>> So the value of the graph should show at around 12:41 80 degrees.
> 
> Temperature from 12:39:20 to 12:40:20 is 0 degrees.
> Temperature from 12:40:20 to 12:41:20 is 80 degrees.
> 
> Next thing RRDtool does is resampling of the data.  You wanted your data
> in 60 second intervals so RRDtool makes sure it is in 60 second intervals.
> 
> (temperature up to 12:40 is 0 degrees)
> temperature from 12:40:00 to 12:41:20 is 0 degrees
> temperature from 12:40:20 to 12:41:00 is 80 degrees
> (temperature after 12:31 is 80 degrees)
> 
> Temperature between 12:40 and 12:41 is:  20/60 * 0 + 40/60 * 80 = 53 1/3 degree.
> 
>> But the sample script shows about "54" degrees for "GAUGE", "step 60 seconds", MAX or LAST
> 
> Well, 53.3333333333333333333 is almost 54.
> 
> LAST and MAX (and AVERAGE and MIN) use resampled data.
> 
>> If I feed the database without ":20" as second, so ":00" I see the expected graph.
>>
>> With CF=LAST or MAX:
>> A) I never expected a graph with a value of 54 at 12:40
>> B) I expect the same graph no matter if I record everything with ":20 seconds" or ":00 seconds"
>>    for a step of 60 seconds. A time shift of the graph :20 or :00 would be correct.
> 
> Your expectations are wrong.  This is in the tutorial.  Read it.
> 
> If you want one-second precision, you should set "step" to be one
> second.  Your database doesn't need to become bigger either, just
> multiply the amount of steps per row (for each RRA) by 60.
> 
> Try the example with those new settings, MAX will work as you expect.
> However, you will still not get graph intervals at HH:MM:20 because
> your database is still in multiples of 60 seconds (thus: HH:MM:00).
> 
> Alex
> 
> --
> 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://lists.ee.ethz.ch/rrd-users
> WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi
> 
> 

--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list