[rrd-users] Simple DEF Arithmetic

Johan Elmerfjord jelmerfj at adobe.com
Tue Aug 6 15:59:54 CEST 2013


Hi Chris,

I assume that it has to do with different "bucket-sizes" which is a
result of your different timeframes.
The max-functions are working on finding the max-values in a Array of
data-values.

Lest just have an example with 10 values

A:  2  3  4  5  5  6  4  3  3  4
B:  6  6  8  5  4  4  3  2  1  1


If you look on each of the value - and sum that up with the same number
of values - you will get:

AB: 8 9 12 10  9 10 7  5  4  5


And the max of this will be 12.

But when looking at a year, you may have consolidated the individual
numbers into larger buckets - where the max-values are kept.
Lets just create an example where two values are "joined" (timeslot
increased to contain 2 values) - so we reduce the buckets to 5.
Most people have maybe 2 weeks of data with full resolution, and then
consolidate this to larger buckets (from minutes to hours) - and then
after a few months of them  - go up to some even larger buckets (hours
to days).
 
With the same max, we would then have:

A2:    3  5   6  4  4
B2:    6  8   4  3  1
And our new max-array of the sum would be:
AB2:  9 13 10 7 5 

Where the max-value is 13 - and not 12 as above.

I'm not sure what you want to accomplish.
If you are trying to look on some bandwidth-numbers you should probably
not use max anyway - as even a very short peak would offset your hole
yearly-data.

Regards, Johan

On Tue, 2013-08-06 at 06:27 -0700, Chris Mason wrote:
> Hi,
> 
> 
> 
> I am trying to create a combined graph with data from two data sources
> and I am seeing some unexpected results. I have removed everything
> from my graph and produced a simple script which recreates the
> problem:
> 
> 
> DEF:A='a.rrd':DS1:MAX
> DEF:B='b.rrd':DS1:MAX
> 
> 
> CDEF:AB=A,B,ADDNAN
> 
> 
> 
> PRINT:A:MAX:'A\: %.3lf %S'
> PRINT:B:MAX:'B\: %.3lf %S'
> PRINT:AB:MAX:'Total\: %.3lf %S'
> 
> 
> If I graph this with "--start -1m" I get the following:
> 
> 
> A: 749.807 M
> 
> B: 1744.822 M
> Total: 2325.624 M
> 
> 
> and with "--start -1y":
> 
> 
> A: 749.807 M
> B: 1744.822 M
> Total: 2430.266 M
> 
> 
> When I attempt to display data with "--start -1y" this is where the
> problem occurs. As you can see the MAX value for A and B hasn't
> changed, but my total has?
> 
> 
> When I convert these values into bps then the difference is 837mbps
> which isn't a small amount.
> 
> 
> Am I doing something wrong or is this expected?
> 
> 
> Thanks,
> Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130806/d457c653/attachment.htm 


More information about the rrd-users mailing list