[rrd-users] Confusion about VDEF total and graph values

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Wed Oct 19 12:32:58 CEST 2016


> This piece of paint art shows best what I mean. Just smaller bars as per
> your suggestion would also work. I understand we will still be showing
> rates, but if the graph visually looks different (more like a histogram)
> when we CDEF'd a rate, that would be a nice visual cue that we did
> something
> to the original data (* 3600 in my case). Of course, title and comment
> strings could also be used to inform the viewer.
>
> <http://rrd-mailinglists.937164.n2.nabble.com/file/n7583447/gas_withlines.gif>

Ack.

AFAIK rrdtool currently does not do this, but you can visualize it
differently.

Two suggestions, both using TIME again. Both assume bars of exactly 1 hour
(3600 seconds) wide. Adjust as needed.  Note: i did not test any of this,
you may need to fix some errors.

#1 two CDEFs.  Both push TIME on the stack, modulo 7200. You have a number
0..7199. Only copy the input if the time is in the {first|second} half of
this range, else push unknown on the stack.
CDEF:val1=orig,TIME,7200,%,3600,LT,orig,UNKN,IF
CDEF:val2=orig,TIME,7200,%,3600,GE,orig,UNKN,IF
now display val1 and val2 using slightly different colors.

#2 two CDEFs again. This time you test against TIME modulo 3600 and
compare using equality only.
CDEF:val1=orig,TIME,3600,%,0,EQ,orig,UNKN,IF
CDEF:val2=orig,TIME,3600,%,0,NE,orig,UNKN,IF
now display val1 in black and val2 using any color you want.

This suggestion only works if RRDtool is working internally with units
much smaller than an hour (or else everything is in val1, displaying only
black). You may need to fetch another data source as well, one that has a
resolution better than one change per hour.  Try this if you see only
black bars.

Once you see bars with black vertical lines (which really are small
areas), you could also display orig in black using LINE1 to fill the top.
The result comes close to your paint art but will not close the gap when a
smaller rate follows a higher one.

Suggestion #3: hack the source. This may not be as simple as it may seem,
but it is certainly doable.

HTH
Alex




More information about the rrd-users mailing list