# [rrd-users] A reason there isn't a CF SUM function?

Tobias Oetiker tobi at oetiker.ch
Wed Aug 22 10:50:18 CEST 2012

```Hi Derek,

Yesterday Derek Haynes wrote:

> Several times on the list, the topic of a CF SUM function has
> risen...just a sample:
>
> http://oss.oetiker.ch/rrdtool/forum.en.html#nabble-td1059458
> http://oss.oetiker.ch/rrdtool/forum.en.html#nabble-td1059458
> http://oss.oetiker.ch/rrdtool/forum.en.html#nabble-td1059458
>
> I'm in need of a similar CF SUM function and I was curious if there
> isn't one because (1) there's a fundemental reason why it's not
> provided or (2) it just hasn't been implemented.

the fundamental problem with a SUM CF is that the values of the RRA
entries would then depend on the step interval of the RRA and thus
fundamentally change the nature of the RRAs ...

> For reason (1), the common argument is you can calculate this by
> multiplying the average by the duration of the CDP. However, this
> doesn't hold when a CDP contains unknowns as the average is only based
> on the known values.

basing a sum on unknown values might be problematic too

a + unknown = a

would mean that you assume that unknown equals 0

where we curently make the assumtion that the unknown part of the
periode was similar to the known parts ...

in any event, on a technical level, what would be required to
achieve what you want (appart for the handling of unknown periodes
within a single step) would be an AVERAGE_UNKNOWN_AS_ZERO
consolidation function ... this would not break the assumptions
about the nature of RRAs and you could calculate your type of SUM
easily ...

cheers
tobi

> The TOTAL operator does exactly what I'm looking for but it's only for
> VDEF statements.

> Any thoughts?
>
> Derek
>
>

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900

```