From a045bfb30a0c1cfccfb34c51114c5185d715e1d4 Mon Sep 17 00:00:00 2001 From: Igor Sfiligoi Date: Wed, 6 Nov 2013 23:38:40 +0000 Subject: Remove the RRDRRAFilterAvgNewSteps class and add spoort for implicit RRA filtering into RRDRRAFilterAvg instead --- src/lib/rrdFilter.js | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src/lib/rrdFilter.js b/src/lib/rrdFilter.js index 87a5170..e50984b 100644 --- a/src/lib/rrdFilter.js +++ b/src/lib/rrdFilter.js @@ -34,6 +34,7 @@ // ================================================================ // Filter out a subset of DSs (identified either by idx or by name) +// Internal function RRDRRAFilterDS(rrd_rra,ds_list) { this.rrd_rra=rrd_rra; this.ds_list=ds_list; @@ -61,6 +62,8 @@ RRDRRAFilterDS.prototype.getElFast = function(row_idx,ds_idx) { } // -------------------------------------------------- +// Public +// NOTE: This class is deprecated, use RRDFilterOp instead function RRDFilterDS(rrd_file,ds_id_list) { this.rrd_file=rrd_file; this.ds_list=[]; @@ -308,6 +311,10 @@ RRAFilterShift.prototype.getRRA = function(idx) {return this.rrd_file.getRRA(idx // getIdx() - Index of RRA to use // getStep() - new step size (return null to use step size of RRA specified by getIdx() +// If a number is passed, it implies to just use the RRA as it is +// If an array is passed, it is assumed to be [rra_id,new_step_in_seconds] +// and a RRDRRAFltAvgOpNewStep object will be instantiated internally + /* Example classes that implements the interface: * * //This RRA Filter object leaves the original RRA unchanged. @@ -392,13 +399,19 @@ RRAFilterAvg.prototype.getElFast = function(row,ds) { } //---------------------------------------------------------------------------- -//Public functions - use these ones for RRA averaging +//Public function - use this one for RRA averaging function RRDRRAFilterAvg(rrd_file, op_obj_list) { this.rrd_file = rrd_file; - this.op_obj_list = op_obj_list; + this.op_obj_list = new Array(); this.rra_list=[]; - for (var i=0; i