max / min values not precise? Bug?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

max / min values not precise? Bug?

spock
Hello,

I have difficulties to interpret the graph created with the parameters below (I omitted some lines, but relevant data should be there).

Graph

The graph shows
- one line with high resolution data
- one line with minimum values per day (step = 86400)
- one line with maximum values per day  (step = 86400)

On the graph I do not understand, why the maximum value of the high resolution data does not correspond with the minimum / maximum values of the compressed data.

On the first and second day e.g. the max values are higher than any data point of the actual high resolution data.

Is this a bug? Or is there any magic I do not understand?

I am using
RRDtool 1.4.7  Copyright 1997-2012 by Tobias Oetiker <tobi@oetiker.ch>
               Compiled Sep  4 2012 23:43:06
on a rasbian raspberry PI.

# rrdtool create temp_pool.rrd --step 900 --start "20140101 00:00" \
# DS:water:GAUGE:1200:-40:50 \
# DS:air:GAUGE:1200:-40:50 \
# DS:roof:GAUGE:1200:-40:80 \
# DS:flow:GAUGE:1200:-40:50 \
# DS:return:GAUGE:1200:-40:50 \
# DS:delta:COMPUTE:return,flow,- \
# DS:pump_flag:GAUGE:1200:0:1 \
# DS:heat_flag:GAUGE:1200:0:1 \
# DS:device:GAUGE:1200:0:90 \
# RRA:AVERAGE:0.5:1:103680 \
# RRA:MIN:0.5:96:3650 \
# RRA:MAX:0.5:96:3650 \
# RRA:AVERAGE:0.5:96:3650



graph_defs='-w 900 -h 525 -D -a PNG -T 15 --slope-mode \
        DEF:water=temp_pool.rrd:water:AVERAGE \
        DEF:air=temp_pool.rrd:air:AVERAGE \
        DEF:delta=temp_pool.rrd:delta:AVERAGE \
        DEF:heat_flag=temp_pool.rrd:heat_flag:AVERAGE \
        DEF:pump_flag=temp_pool.rrd:pump_flag:AVERAGE \
        DEF:roof=temp_pool.rrd:roof:AVERAGE \
        DEF:roof24hmax=temp_pool.rrd:roof:MAX:step=86400 \
        DEF:roof24hmin=temp_pool.rrd:roof:MIN:step=86400 \
        DEF:air24hmax=temp_pool.rrd:air:MAX:step=86400 \
        DEF:air24hmin=temp_pool.rrd:air:MIN:step=86400 \
        CDEF:air24harea=air24hmax,air24hmin,- \
        CDEF:roof24harea=roof24hmax,roof24hmin,- \
'COMMENT:"\t\t      Max      Min                   Max     Min\n" \
        LINE2:roof#0000FF:"Dach norm" \
        LINE2:roof24hmin#FF0000:"Dachmin" \
        AREA:roof24harea#FF000020::STACK \
        LINE2:roof24hmax#00FF00:"Dachmax"'

Thanks for any hint!!
Reply | Threaded
Open this post in threaded view
|

Re: max / min values not precise? Bug?

Simon Hobson
spock <[hidden email]> wrote:

> I have difficulties to interpret the graph created with the parameters below
> (I omitted some lines, but relevant data should be there).
>
> <http://rrd-mailinglists.937164.n2.nabble.com/file/n7582374/tempmo1.png>
>
> The graph shows
> - one line with high resolution data
> - one line with minimum values per day (step = 86400)
> - one line with maximum values per day  (step = 86400)
>
> On the graph I do not understand, why the maximum value of the high
> resolution data does not correspond with the minimum / maximum values of the
> compressed data.

Because the line is not showing all the data.

> On the first and second day e.g. the max values are higher than any data
> point of the actual high resolution data.

> # rrdtool create temp_pool.rrd --step 900 --start "20140101 00:00" \

> graph_defs='-w 900 -h 525 -D -a PNG -T 15 --slope-mode \

First off, you haven't provided all the information - like what timescale the graph is plotted over (it looks like a bit over 2 weeks) or the actual data.
At a step of 900s, that's 96 periods per day. Over 16 days, that's over 1500 periods. You are plotting a graph that's around a third of that in pixels, so around 3 points will be averaged per pixel.

So you'd need to look carefully at the actual data to see what is "missing" from the graph you are plotting.

What I've done for a few of my graphs is plot a shaded area between min and max. Do a CDEF x_spread=x_max,x_min,- (where x_min is x:MINIMUM and x_max is x:MAXIMUM) and plot an area with full transparency of x_min, then stack and area of (say) 50% transparency of x_spread on top of it. Then draw your line of x. I suspect that with your parameters you'll find that the shaded area touches the min and max lines.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: max / min values not precise? Bug?

spock
Hi Simon,

> Because the line is not showing all the data.

I think the lines shows all the data.

The timescale is 1 month (July 2014 = 31 days =  2976 data points).
I tried to increase the x- resolution to 3000 pixel, but that did not change the graph. I was hoping, that - according to your statement - rrdtool does not have to average a few pixels to one data point, if the resolution is high enough.

The red area in my example graph is exactly what you are asking for - but the blue line with the detailed data (roof) does not touch the upper limits of the red area (roof24harea).

CDEF:roof24harea=roof24hmax,roof24hmin,- \

LINE2:roof#0000FF:"Dach norm" \
        LINE2:roof24hmin#FF0000:"Dachmin" \
        AREA:roof24harea#FF000020::STACK \
        LINE2:roof24hmax#00FF00:"Dachmax"'

I think, that the
 DEF:roof24hmax=temp_pool.rrd:roof:MAX:step=86400 \
get a max value of about 59 ยด, whereas the
LINE2:roof#0000FF:"Dach norm" \
does not show any data above 51 for the same day ("Mi").

The lower limits (MIN) seem to be ok though.

Regards,
Spock