picar / pyrrd

Automatically exported from code.google.com/p/pyrrd
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Implicit creation of prediction CFs when HWPREDICT's rra_num is unspecified #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In rrd.py, class RRA there's a bit that generates the syntax for HWPREDICT CFs.

        elif self.cf == 'HWPREDICT':
            tail += ':%s:%s:%s' % (self.rows, self.alpha, self.beta)
            tail += ':%s:%s' % (self.seasonal_period, self.rra_num)

The problem with this code is that it doesn't allow for the implict creation of 
SEASONAL, DEVPREDICT, etc as per 
http://www.mrtg.org/rrdtool/doc/rrdcreate.en.html: "the RRDtool create command 
supports implicit creation of the other four when HWPREDICT is specified alone 
and the final argument rra-num is omitted." This is further echoed in the 
syntax specified on the same page: "RRA:HWPREDICT:rows:alpha:beta:seasonal 
period[:rra-num]".

I'd suggest patching the above code to the following (adjust code style as per 
your guidelines, of course).

        elif self.cf == 'HWPREDICT':
            tail += ':%s:%s:%s:%s' % (self.rows, self.alpha, self.beta, self.seasonal_period)
            if self.rra_num != None: tail += ':%s' % (self.rra_num)

Original issue reported on code.google.com by bradbeattie on 10 Oct 2010 at 5:00

GoogleCodeExporter commented 9 years ago
Thanks, Brad! This has been committed now.

Original comment by duncan.m...@gmail.com on 22 Jun 2011 at 3:57