[rrd-users] Graphs with rate per day rather than rate per second

Steve Shipway s.shipway at auckland.ac.nz
Fri Jan 21 23:47:21 CET 2011

Shawn wrote:
> rrdtool graph count.png --end now --start end-180d
> DEF:count=doc_counter.rrd:count:AVERAGE CDEF:perday=count,86400,*
> LINE1:perday#0000FF:"docs per day\l"

Just a comment, but it's probably Bad Practice to make a CDEF with the name 'count' since 'COUNT' is a special function in RRD RPN.  You get away with it here because the variable names are case sensitive (so RRDtool knows COUNT != count) but it makes for confusion.

Try prefixing a DS name with 'ds', a vdef with 'v' and a cdef with 'c' for clarity (I developed this idea when I started to get confused, but havent backported it to routers2 completely yet):

rrdtool graph count.png --end now --start end-180d
DEF:dscount=doc_counter.rrd:count:AVERAGE CDEF:cperday=dscount,86400,*
LINE1:cperday#0000FF:"docs per day\l"

Works the same but can help to make complex graph definitions more readable -- and will protect you from problems should any future verison of RRDTool make the RPN functions case-insensitive.


Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

More information about the rrd-users mailing list