[rrd-users] Re: Gap in right of graph

Michael Van Camp mcamp at alchemy.net
Sat Jan 20 23:00:58 MET 2001



I had a similar problem- I like Alex's explanation of why it is happening
even though I thought of it differently... I did some rrdtool fetch's and I
noticed that, say it was 14:56 and data is on 00,05,10, etc... and I pull
data with the endpoint of "now".  I noticed that half the time the fetched
datapoints included one at the end that was in the future... the next
datapoint to be sampled.  It was either zero or NAN, I forget which...

Either way, I would get a drop to zero on the right side of the graph, which
would freak out the people monitoring the graphs... they thought traffic
went to zero when it didn't.  Anyways, this is how I fixed it in my PERL cgi
that generates my graphs:

#  This CDEF handles the phantom drop, checking for timestamp greater than
now,
#       and using the previous value if true.
push( @command, qq/CDEF:$inlabelp=TIME,NOW,LT,$inlabel,PREV,IF/ );
push( @command, qq/CDEF:$outlabelp=TIME,NOW,LT,$outlabel,PREV,IF/ );

Hope that helps!

> -----Original Message-----
> From: rrd-users-bounce at list.ee.ethz.ch
> [mailto:rrd-users-bounce at list.ee.ethz.ch]On Behalf Of Aragon Gouveia
> Sent: Saturday, January 20, 2001 7:38 AM
> To: Alex van den Bogaerdt
> Cc: RRD users
> Subject: [rrd-users] Re: Gap in right of graph
>
>
>
> I thought it had something to do with that. I tried what you said but I
> still get that gap sometimes. I'd say every second graph update (I'm
> using -z as well so not all the graphs update every 2 minutes). I tried
> setting the endtime to now-240 (and greater) and still the same thing.
> Sometimes there's no gap, sometimes there is.
>
>
> Thanks,
> Aragon
>
> ----- Original Message -----
> From: "Alex van den Bogaerdt" <alex at slot.hollandcasino.nl>
> To: "Aragon Gouveia" <aragon at cyberhost.co.za>
> Cc: "RRD users" <rrd-users at list.ee.ethz.ch>
> Sent: Saturday, January 20, 2001 3:59 PM
> Subject: Re: [rrd-users] Gap in right of graph
>
>
> > Aragon Gouveia wrote:
> >
> > > The database gets updated every 2 minutes. At the same time,
> a new graph
> for
> > > each RRA gets drawn every 2 minutes. However, every graph
> without a step
> of
> > > 1 gets a gap between the beginning of the graph and the
> boundary of the
> > > graph canvis. It makes it appear as if there is no traffic in that gap
> area
> > > when there is. Am I doing something wrong? Is there anyway to
> get rid of
> > > those leading gaps? Sometimes the gaps are there, sometimes not. I've
> also
> > > seen some other sites using rrdtool to do graphing and they also have
> gaps
> > > in the same place on some of their graphs.
> >
> > I assume you mean the right hand side of the graph.
> > If the last known value in your database is at, for instance, 14:54:00
> > and you create the graph at 14:55:30, there is no traffic *in the RRA*
> > for the interval 14:54:00 to 14:55:30.  This is the gap you're seeing.
> >
> > The way to get rid of it?  Just graph until 14:54:00, not "now".
> > If your front end does something like
> > "rrdtool graph x.gif DEF:.... " etcetera, change it into:
> >
> > TIMENOW=`date +%s`
> > TIMENOW=$((TIMENOW/120))
> > TIMENOW=$((TIMENOW*120))
> > rrdtool graph x.gif --e $TIMENOW DEF:.....
> >
> > The 120 in these calculations is the same as the interval for the
> > smallest RRA.
> >
> > cheers,
> > --
> >    __________________________________________________________________
> >  / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
> > | work                                                         private |
> > | My employer is capable of speaking therefore I speak only for myself |
> > +----------------------------------------------------------------------+
> > | Technical questions sent directly to me will be nuked. Use the list. |
> > +----------------------------------------------------------------------+
> > | http://faq.mrtg.org/                                                 |
> > | http://rrdtool.eu.org  --> tutorial                                  |
> > +----------------------------------------------------------------------+
> >
>
>
> --
> 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://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin    http://www.ee.ethz.ch/~slist/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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list