[rrd-users] Things not adding up

Jared Watkins jared at jaredwatkins.com
Tue Apr 5 18:26:26 CEST 2011

On 4/5/11 12:01 PM, "Tobias Oetiker" <tobi at oetiker.ch> wrote:

>Hi Jared,
>Today Jared Watkins wrote:
>> I'm working on my first custom rrd project and I'm having an issue with
>> things not adding up correctly in a stacked graph.
>> http://farm6.static.flickr.com/5105/5592424900_9a13016d57_b.jpg
>> I'm most interested in the max values for this data and if you add up
>> the individual max values you get a value that's 120.15 greater than the
>> total printed on the graph both visually and in the gprints.   Here is
>> another example using only 2 samples:
>> http://farm6.static.flickr.com/5095/5591833819_9a5942d74a_b.jpg
>> And the relevant code?
>>     RRDs::graph "$img/combined-$interval->{label}.png",
>>         "$interval->{period}", "$interval->{end}",
>>         "-t DSL Aggerate - $interval->{label}",
>>         "-h", "$interval->{rezH}", "-w", "$interval->{rezW}",
>>         "-l 0",
>>         "-a", "PNG",
>>         "-v bits/sec",
>>         "-b", "1000",
>>         "DEF:er01agas1in=$rrd_dir/er01.yul01.30004.rrd:in:MAX",
>>         "DEF:er01agas1out=$rrd_dir/er01.yul01.30004.rrd:out:MAX",
>>         "DEF:er01agas2in=$rrd_dir/er01.yul01.1418299.rrd:in:MAX",
>>         "DEF:er01agas2out=$rrd_dir/er01.yul01.1418299.rrd:out:MAX",
>>         "DEF:er01agas3in=$rrd_dir/er01.yul01.1385232.rrd:in:MAX",
>>         "DEF:er01agas3out=$rrd_dir/er01.yul01.1385232.rrd:out:MAX",
>>         "DEF:er01agas4in=$rrd_dir/er01.yul01.1819030.rrd:in:MAX",
>>         "DEF:er01agas4out=$rrd_dir/er01.yul01.1819030.rrd:out:MAX",
>>         "DEF:er02agas1in=$rrd_dir/er02.yul01.6.rrd:in:MAX",
>>         "DEF:er02agas1out=$rrd_dir/er02.yul01.6.rrd:out:MAX",
>> +,+,+",
>> out,+,+,+,+",
>>         "LINE1:totalout#000000:Total Out     ",
>>         "GPRINT:totalout:MAX: Max\\: %5.2lf %S",
>>         "GPRINT:totalout:AVERAGE: Avg\\: %5.2lf %S",
>>         "GPRINT:totalout:LAST: Current\\: %5.2lf %Sbits/sec\\n",
>> The data is being collected every 60 seconds and the rras are setup to
>> 7 days worth of 1 minute samples and 3 years worth of daily max values
>> long term peak trending.   I can't find any reason these shouldn't be
>> up.. and I'm at a loss as to how to fix it.
>within the chart, the data gets pre-consolidated to the pixel
>resolution of the graph, so if one pixel is 2 minutes wide, the
>incoming max values will be consolidated into one slot using the
>same consolidation function used on the original data ...
>when you then add these pre consolidated max values the result will
>be larger the total ...

>How does that explain the second example with only two samples?  If you
>add the max values up manually you get a value that is 21.9 higher than
>the total showing on the graph.  I considered this and played with
>different graph resolutions and time periods (getting it to one pixel per
>sample) but that didn't correct it.  If I do a graph with only one sample
>the total comes out correct.. but any more than that and it's off by an
>increasing amount that I can't pin down.


More information about the rrd-users mailing list