[rrd-users] How to get Average for defined time only
Tobias Oetiker
tobi at oetiker.ch
Thu Jan 21 10:46:11 CET 2010
Today Vinod Sharma wrote:
> I think I can add the start and end dates like below to get the average for
> last week.
>
> DEF:A=test.rrd:data:AVERAGE:end=now-1w:start=end-1w
>
> Really appriciate if you can suggest me how to do this to get data for day
> time only for all days.
ah ... in that case you may want to conjure up a CDEF that turns
the date to UNKNOWN outsite business hours ... using either TIME or
LOCALTIME as input.
cheers
tobi
>
> On Thu, Jan 21, 2010 at 1:26 PM, Tobias Oetiker <tobi at oetiker.ch> wrote:
>
> > Hi Vinod,
> >
> > Today Vinod Sharma wrote:
> >
> > > I am creating daily graphs using RRDTool from the logs of my application.
> > I
> > > am using below settings to do the same.
> > >
> > > rrdtool graph - \
> > > --start=end -7d \
> > > --end=midnight \
> > > --imgformat=PNG \
> > > --width=1048 \
> > > --base=1000 \
> > > --height=266 \
> > > --logarithmic \
> > > --interlaced \
> > > DEF:A=test.rrd:data:AVERAGE \
> > > CDEF:A=f,POP,LTIME,86400,%,3600,/,FLOOR,DUP,23,LT,*,6,GT,INF,UNKN,IF \
> > > AREA:A#7FFFD4: Day Time \
> > > LINE2:f#DDA0DD:data AVERAGE
> >
> > >
> > > Currently I am displaying the day time as shown in above example but I
> > want
> > > to get the output average of day time data only i.e. 7AM to 10 PM. Can
> > > anyone please suggest how can I get the average of day time data only and
> > > skip other data.
> >
> > you can use a second DEF where you pull in only partial data giving
> > the exact start and end time and then calculate the average for
> > from that second import ...
> >
> > and no, I have no example and I have not tried it ... but I think
> > it should work :-)
> >
> > cheers
> > tobi
> >
> >
> > --
> > Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
> > http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
> >
>
>
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the rrd-users
mailing list