#180283 rrdtool: CDEF function PREV(name) timesteps far too mauch

Package:
rrdtool
Source:
rrdtool
Description:
time-series data storage and display system (programs)
Submitter:
Goswin von Brederlow
Date:
2015-09-08 08:45:04 UTC
Severity:
normal
#180283#5
Date:
2003-02-08 16:37:10 UTC
From:
To:
Hi,

I'm drawing a graph with width 720 over a 1d time period. My rrd db
has 720 rows and an entry every 2 minutes. So I have one datapoint per
pixel.

If I draw each datapoint and the PREV of each datapoint both graphs
should be spaced 1 pixel apart, right?

What I see is about 10 pixels (or 10 datapoints or 20 minutes) apart.
Also at the end (lat 10 pixels) it wraps around to the graph defined
by the CDEF before that it seems. This might be ralted to my other
bugreport about PREV segfaulting.

MfG
	Goswin

#180283#10
Date:
2003-02-08 22:31:12 UTC
From:
To:
What is the exact command line that you are using?  Are you requesting a
specific resolution?

#180283#15
Date:
2003-02-08 23:41:54 UTC
From:
To:
Matt Zimmerman <mdz@debian.org> writes:

donitor calls rrdcgi -f <tmpfile>.

MfG
        Goswin
---------------------------------------------------------------------- <!-- monitor.cgi is the main cgi-script for creating and displaying the donkey traffic graphs (c) arisTo 02/2002 - hope you like it ;) --> <HTML> <HEAD> <META http-equiv=Refresh content="120"> <TITLE>Donkey Transfer Statistics</TITLE> <STYLE TYPE="text/css"> BODY { font-family: Helvetica } </STYLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <CENTER><TABLE BORDER=0><TR><TD ALIGN="center"> <IMG SRC="images/esel.gif" ALT="Donkey Monitor v1.1 © arisTo 02/2002 - last rrd-update <RRD::TIME::LAST ../dbase/esel.rrd %H:%M:%S>" BORDER=0> </TD><TD ALIGN="center"> <IMG BORDER=0 SRC="images/last12h.gif" ALT="click graphs to cycle through available time-windows"> </TD></TR><TR><TD ALIGN="center"> <IMG SRC="images/workload.gif" ALT="graph is showing peer-cumulative transfer-rate-stats for the monitored eDonkey client"> </TD><TD> <A HREF="monitor.cgi?window=1d"> <RRD::GRAPH images/mix_12h.png --imginfo '<IMG BORDER=0 ALT="click here for next time-window" SRC="images/mix_12h.png">' --imgformat PNG --start 'now-12h' --vertical-label "bytes / sec" --width 720 --height 250 --lazy DEF:down1=../dbase/esel.rrd:tcp_down:AVERAGE DEF:up1=../dbase/esel.rrd:tcp_up:AVERAGE DEF:down2=../dbase/esel.rrd:udp_down:AVERAGE DEF:up2=../dbase/esel.rrd:udp_up:AVERAGE DEF:down3=../dbase/esel.rrd:sum_down:AVERAGE DEF:up3=../dbase/esel.rrd:sum_up:AVERAGE CDEF:drate1=down1,120,/ CDEF:urate1=up1,120,/ CDEF:urateg1=up1,-120,/ CDEF:drate2=down2,120,/ CDEF:urate2=up2,120,/ CDEF:urateg2=up2,-120,/ CDEF:drate3=down3,120,/ CDEF:urate3=up3,120,/ CDEF:urateg3=up3,-120,/ CDEF:sdrate3=PREV(sdrate3) AREA:drate1#e1ca1b:"tcp down rate" GPRINT:drate1:MIN:"(min\:%8.2lf %s" GPRINT:drate1:AVERAGE:", avg\:%8.2lf %s" GPRINT:drate1:MAX:", max\:%8.2lf %s" GPRINT:drate1:LAST:", last\:%8.2lf %s)" COMMENT:"\s" COMMENT:"\s" AREA:drate2#e1ca1b:"udp down rate" GPRINT:drate2:MIN:"(min\:%8.2lf %s" GPRINT:drate2:AVERAGE:", avg\:%8.2lf %s" GPRINT:drate2:MAX:", max\:%8.2lf %s" GPRINT:drate2:LAST:", last\:%8.2lf %s)" COMMENT:"\s" COMMENT:"\s" AREA:drate3#e1ca1b:" down rate" GPRINT:drate3:MIN:"(min\:%8.2lf %s" GPRINT:drate3:AVERAGE:", avg\:%8.2lf %s" GPRINT:drate3:MAX:", max\:%8.2lf %s" GPRINT:drate3:LAST:", last\:%8.2lf %s)" COMMENT:"\s" COMMENT:"\s" COMMENT:"\s" AREA:urateg1#87b1ee:"tcp up rate " GPRINT:urate1:MIN:"(min\:%8.2lf %s" GPRINT:urate1:AVERAGE:", avg\:%8.2lf %s" GPRINT:urate1:MAX:", max\:%8.2lf %s" GPRINT:urate1:LAST:", last\:%8.2lf %s)" COMMENT:"\s" COMMENT:"\s" AREA:urateg2#87b1ee:"udp up rate " GPRINT:urate2:MIN:"(min\:%8.2lf %s" GPRINT:urate2:AVERAGE:", avg\:%8.2lf %s" GPRINT:urate2:MAX:", max\:%8.2lf %s" GPRINT:urate2:LAST:", last\:%8.2lf %s)" COMMENT:"\s" COMMENT:"\s" AREA:urateg3#87b1ee:" up rate " GPRINT:urate3:MIN:"(min\:%8.2lf %s" GPRINT:urate3:AVERAGE:", avg\:%8.2lf %s" GPRINT:urate3:MAX:", max\:%8.2lf %s" GPRINT:urate3:LAST:", last\:%8.2lf %s)" LINE1:drate3#000000: LINE1:urateg3#000000: LINE1:drate2#000000: LINE1:urateg2#000000: LINE1:sdrate3#F00000: > </A> </TD></TR><TR><TD ALIGN="center"> <IMG SRC="images/peers.gif" ALT="graph is showing the number of open tcp-connections associated to the monitored eDonkey client"> </TD><TD> <TABLE><TR><TD> <A HREF="monitor.cgi?window=1d"> <RRD::GRAPH images/connections_12h.png --imginfo '<IMG BORDER=0 ALT="click here for next time-window" SRC="images/connections_12h.png">' --imgformat PNG --lower-limit 0 --start 'now-12h' --vertical-label "connections" --width 720 --lazy DEF:conn=../dbase/esel.rrd:connections:AVERAGE AREA:conn#e1ca1b:"active connections" LINE1:conn#000000: GPRINT:conn:MIN:"(min\:%4.2lf\g" GPRINT:conn:AVERAGE:", avg\:%4.2lf\g" GPRINT:conn:MAX:", max\:%4.2lf\g" GPRINT:conn:LAST:", last\:%4.2lf)" > </A> </TD></TR></TABLE></CENTER> <TABLE WIDTH="100%"><TR><TD align="left"> <SMALL><b>∑ ⇓</b> 5.2228 GB / <b>⇑</b> 2.629 GB (67% / 33%)</SMALL> </TD><TD align="right"> <SMALL>© arisTo 02/2002</SMALL> </TD></TR></TABLE> </BODY> </HTML>
#180283#26
Date:
2015-08-26 09:26:42 UTC
From:
To:
Hello Goswin

I'm cleaning up the rrdtool bug list, and I dig a bit into this one
submitted back in 2003!
https://bugs.debian.org/180283

I'm sorry no one from the Debian project answered you since then.


You listed the cgi source, but not the actual command used to create the
rrd database.
A cgi only works if a database is created first. This is almost
impossible to answer to your bug report without that information.

I can only assume you are (were) using code from the original donitor
whose source code is available at http://sourceforge.net/projects/donitor/
There, in file /sbin/update_rrd.pl, in function create_rrd, the step is
set to 120 seconds, and the heartbeat to 240 seconds:
assume a moment you were using these settings.

This means you have:
- A 2 minutes resolution for 12 hours (meaning if last value is "now",
then first value is now-11h58)
- A 8 minutes resolution for 48 hours
- A 32 minutes resolution for 8 days
- ...


Also, you defined:
CDEF:sdrate3=PREV(sdrate3)
which is impossible. PREV must be applied to another value, not to
itself! This may be the source of the problem.
I'll assume you meant sdrate3=PREV(drate3)


I may have been able to reproduce the issue, but not just for sdrate3,
all the data is showing a 8 minutes resolution.

Therefore, it seems normal that PREV() is 8 minutes earlier. Is it
possible you did not notice that everything has a 8 pixel horizontal
resolution but only that the two lines were 8 pixels apart?

As far as I can tell, x=PREV(x) is not working any more, it doesn't show
weird things and does not loop nor overflow any more. This may have been
fixed upstream.


Now why do we have a 8 minutes resolution?

It tried different values for --start.
--start 'end-12h00' yield a 8 minutes resolution
--start 'end-11h00' yield a 8 minutes resolution
--start 'end-10h59' yield a 2 minutes resolution

I may dig a bit in that part. There may be two issues there. A time zone
one (I'm UTC+1) and an interval one...

If you still have the data, know the way you created the rrd file,
and/or how it's filled, it will help pin point that issue.

Thanks

#180283#35
Date:
2015-09-08 08:41:17 UTC
From:
To:
Sorry, after 12 years I have no idea how I did set that up anymore nor
do I still run it.

MfG
	Goswin