[rrd-users] CDEF question

DEIGNAN Ciaran C.DEIGNAN at rsd.com
Thu Nov 5 16:31:42 CET 2015

Hi All,

I want to use RRDtool to show information about users connected to an internal application.
I want the application to expose the following information

nec => number of connections ended,
tec => cumulative time of ended connections,
noc => current open connections

>From these stats I'd like to get the average time of connections, once they're closed.
Basically I want to graph (nec2 - nec1) / (tec2 - tec1)

However if I declare nec and tec as counters can I use a CDEF to divide the time by the number of connections ?
I don't think that does what I want.

Can someone give me an example of how to do this?

Currently I have this

rrdtool create connections.rrd --start "20100101 00:00" --step 1 \
        DS:nec:COUNTER:86400:0:4294967295 \
        DS:tec:COUNTER:86400:0:4294967295 \
        DS:noc:GAUGE:86400:0:4294967295 \
        RRA:AVERAGE:0.5:1:86400 \
        RRA:AVERAGE:0.5:60:46080 \
        RRA:AVERAGE:0.5:3600:43920 \

rrdtool graph test-1hour.png -w 1024 -h 512 \
        --start end-1h --end now \
        DEF:NCNX=connections.rrd:noc:AVERAGE \
        DEF:NEND=connections.rrd:nec:AVERAGE \
        DEF:SUMTIME=connections.rrd:tec:AVERAGE \
        LINE2:NCNX#0000FF:"current connections\l" \
        LINE2:NEND#CC00FF:"Closed connections\l" \
        LINE2:AVTIME#00CCFF:"Connection Duration\l" \


Ciaran Deignan
RSD Open Systems Support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20151105/f4fc107a/attachment.html>

More information about the rrd-users mailing list