Discussion:
[rrd-users] Stacking
(too old to reply)
Devante Vargas
2015-08-11 17:55:18 UTC
Permalink
I am working on creating a graph for my ping script. It collects, min, max
and average response times. I have added the ::STACK for the AREA after the
first AREA is defined. Problem is it adds the next two on top and moves it
up a notch, e.g. Min response time is 0.42 (this is measured accurately and
on the Y axis it shows it hits 0.42ms) but the next 2, e.g max response
times, 0.64ms, it places it on top of the min area and when aligned with
the Y axis it shows at 1.08ms, and then average, 0.60ms on top of that and
shows aligned at the value of 1.68ms.

Is there anyway to get the max and average to start at zero instead of from
where the last area ended up at?

So far I got this as my syntax:

rrdtool.exe graph graph.png
--title "Daily ICA Port Latency"
--vertical-label "milliseconds"
--slope-mode
--start end-1d -X 0
DEF:def_min=latency.rrd:response:MIN
DEF:def_max=latency.rrd:response:MAX
DEF:def_avg=latency.rrd:response:AVERAGE
CDEF:cdef_min=def_min,1000,/
CDEF:cdef_max=def_max,1000,/
CDEF:cdef_avg=def_avg,1000,/
VDEF:vdef_min=def_min,MINIMUM
VDEF:vdef_max=def_max,MAXIMUM
VDEF:vdef_avg=def_avg,AVERAGE
AREA:def_min#54EC48
AREA:def_max#EC9D48::STACK
AREA:def_avg#48C4EC::STACK
PRINT:vdef_min:%.2lf
PRINT:vdef_max:%.2lf
PRINT:vdef_max:%.2lf

thank you,

Devante
Simon Hobson
2015-08-11 21:29:55 UTC
Permalink
I am working on creating a graph for my ping script. It collects, min, max and average response times. I have added the ::STACK for the AREA after the first AREA is defined. Problem is it adds the next two on top and moves it up a notch, e.g. Min response time is 0.42 (this is measured accurately and on the Y axis it shows it hits 0.42ms) but the next 2, e.g max response times, 0.64ms, it places it on top of the min area and when aligned with the Y axis it shows at 1.08ms, and then average, 0.60ms on top of that and shows aligned at the value of 1.68ms.
Is there anyway to get the max and average to start at zero instead of from where the last area ended up at?
Several ways to do this, depending on what you want.

One would be to plot an area for max, then an area for avg, then an area in white for min - no stack involved. So you end up with a colour band from min to avg, and a different colour band from avg to max.

Another one I've used is : use a CDEF to get the difference between max and min, plot min in white (or transparent), then stack the CDEF on top of that, then draw a line for avg. I tend to use a solid colour for the line, and the same colour (but with a lot of transparency) for the min-max spread - that way the min-max spread area doesn't obliterate what's been plotted before.
Loading...