diff options
Diffstat (limited to 'doc/lib')
-rw-r--r-- | doc/lib/rrdFilter_js.html | 156 |
1 files changed, 79 insertions, 77 deletions
diff --git a/doc/lib/rrdFilter_js.html b/doc/lib/rrdFilter_js.html index 5738675..ea27bb6 100644 --- a/doc/lib/rrdFilter_js.html +++ b/doc/lib/rrdFilter_js.html @@ -62,9 +62,40 @@ <H2> Main Classes: <H2> <HR> <H3> RRD Filter Classes: <H3> -<H2 CLASS="heading-2-western"><A NAME="RRDFilterDS"></A>Class RRDFilterDS</H2> -<P> Note: This class is deprecated. Use <A HREF="#RRDFilterOp">RRDFilterOp</A> instead.</P> -<P> This class filters out a subset of DSs from an RRD identified by index or name. </P> +<P> +<H2 CLASS="heading-2-western"><A NAME="RRDFilterOp"></A>Class RRDFilterOp</H2> +<P>This class filters all of the DSs in an RRD by a list of filter objects.</P> +<PRE> + The filter object must implement the following interface + getName() - Symbolic name give to this function + getDSName() - list of DSs used in computing the result (names or indexes) + computeResult(val_list) - val_list contains the values of the requested DSs (in the same order) + + Example classes that implement the interface: + function Itentity(ds_name) { //Leaves the DS alone. + this.getName = function() {return ds_name;} + this.getDSNames = function() {return [ds_name];} + this.computeResult = function(val_list) {return val_list[0];} + } + function sumDS(ds1_name,ds2_name) { //Sums the two DSs. + this.getName = function() {return ds1_name+"+"+ds2_name;} + this.getDSNames = function() {return [ds1_name,ds2_name];} + this.computeResult = function(val_list) {return val_list[0]+val_list[1];} + } + + Lets say you have 2 DSs. To add a summed DS of DS1 and DS2: + var ds0_name = rrd_data.getDS(0).getName(); + var ds1_name = rrd_data.getDS(1).getName(); + rrd_data = new RRDFilterOp(rrd_data, [new Identity(ds0_name), + new Itentity(ds1_name), new sumDS(ds0_name, ds1_name]); +</PRE> +<P>If a string is passed, it is assumed to be the name of a DS, and the Identity transformation is applied.<BR> + If an integer is passed, it is assumed to be the index or a DS, and the Identity equivalent is applied.<BR> + So this gives an equivalent result:</P> +<PRE> + rrd_data = new RRDFilterOp(rrd_data, [ds0_name,1, new sumDS(ds0_name, ds1_name]); +</PRE> +<P>Its arguments are: rrd_file and op_obj_list (list of ds filters). <P>This class implements the following methods:</P> <DIV ALIGN=RIGHT> <TABLE WIDTH=90% BORDER=1 CELLPADDING=2 CELLSPACING=3> @@ -161,41 +192,46 @@ </TR> </TBODY> </TABLE> -</DIV> -<P> -<H2 CLASS="heading-2-western"><A NAME="RRDFilterOp"></A>Class RRDFilterOp</H2> -<P>This class filters all of the DSs in an RRD by a list of filter objects.</P> -<PRE> - The filter object must implement the following interface - getName() - Symbolic name give to this function - getDSName() - list of DSs used in computing the result (names or indexes) - computeResult(val_list) - val_list contains the values of the requested DSs (in the same order) +</DIV> - Example classes that implement the interface: - function Itentity(ds_name) { //Leaves the DS alone. - this.getName = function() {return ds_name;} - this.getDSNames = function() {return [ds_name];} - this.computeResult = function(val_list) {return val_list[0];} - } - function sumDS(ds1_name,ds2_name) { //Sums the two DSs. - this.getName = function() {return ds1_name+"+"+ds2_name;} - this.getDSNames = function() {return [ds1_name,ds2_name];} - this.computeResult = function(val_list) {return val_list[0]+val_list[1];} - } +<HR> +<H3 CLASS="heading-2-western">RRA Filters:</H3> +<H2 CLASS="heading-2-western"><A NAME="RRDRRAFilterAvg"></A>Class RRDRRAFilterAvg</H2> +<P>This class creates new RRAs (based on original RRAs in the RRD File) that have different time steps. This is useful for creating new RRA graphs with different time steps without actually creating and filling new RRAs. +<P>Arguments: +<UL><LI>1. The RRD File +<LI>2. List of Filter Objects. Each object must instantiate getIdx, which returns the index of the RRA to use in the RRD File, and getStep, which returns the step size of the RRA. (If getStep returns null, the filter will use the original step size given by the RRA specified by getIdx). </UL> +<P>Examples of RRA Filter Objects: </P> +<PRE> + //This RRA Filter object leaves the original RRA unchanged. + function RRAIdentity(rra_idx) { + this.getIdx = function() {return rra_idx;} + this.getStep = function() {return null;} + } + + /* This Filter creates a new RRA with a different step size + / based on another RRA, whose data the new RRA averages. + / rra_idx should be index of RRA with largest step size + / that doesn't exceed new step size. */ - Lets say you have 2 DSs. To add a summed DS of DS1 and DS2: - var ds0_name = rrd_data.getDS(0).getName(); - var ds1_name = rrd_data.getDS(1).getName(); - rrd_data = new RRDFilterOp(rrd_data, [new Identity(ds0_name), - new Itentity(ds1_name), new sumDS(ds0_name, ds1_name]); + function RRA_Avg(rra_idx,new_step_in_seconds) { + this.getIdx = function() {return rra_idx;} + this.getStep = function() {return new_step_in_seconds;} + } </PRE> -<P>If a string is passed, it is assumed to be the name of a DS, and the Identity transformation is applied.<BR> - If an integer is passed, it is assumed to be the index or a DS, and the Identity equivalent is applied.<BR> - So this gives an equivalent result:</P> +<P>For instance, if you have 3 RRAs with 5 second, 60 second and 3600 second intervals, and would like an RRA with 1800 second steps along with them, create: <PRE> - rrd_data = new RRDFilterOp(rrd_data, [ds0_name,1, new sumDS(ds0_name, ds1_name]); + object_list = [new RRAIdentity(0), new RRAIdentity(1), new RRAItentity(2), new RRA_Avg(1,1800)]. + new RRDRRAFilterAvg(rrd_file, object_list); </PRE> -<P>Its arguments are: rrd_file and op_obj_list (list of ds filters). +<P>It's best to use the RRA with the next smallest step size as a basis. It's also best to make steps integer multiples of the original RRA step sizes. For instance, using a 45 minute step, a 6 hour (= 45mins x 8) step would be better than 4 hour step (=45 mins x 5.33...). +<P>Given that the above classes are likely the most useful ones, the user can use an integer instead of a RRAIdentity object, + and an Array(2) instead of the RRA_Avg object:</P> +<PRE> + object_list = [0,1,2,[1,1800]] + new RRDRRAFilterAvg(rrd_file, object_list); +</PRE> + <P>This class implements the following methods:</P> <DIV ALIGN=RIGHT> <TABLE WIDTH=90% BORDER=1 CELLPADDING=2 CELLSPACING=3> @@ -294,15 +330,11 @@ </TABLE> </DIV> -<HR> -<H3 CLASS="heading-2-western">RRA Filters:</H3> -<H2 CLASS="heading-2-western"><A NAME="RRAFilterShift"></A>Class RRAFilterShift</H2> -<P>This class creates new, time-shifted RRAs. Originally developed for timezone shifting. Currently to be considered deprecated. -<P>Arguments: -<UL><LI>1. The RRD File -<LI>2. Shift Int - the number of seconds to shift by (1 hour = 3600s). -<LI>3. RRA index List - A list of the RRAs (by their indicies) to be shifted; usually all RRAs in the File are included. </UL> +<HR> +<H2 CLASS="heading-2-western"><A NAME="RRDFilterDS"></A>Class RRDFilterDS</H2> +<P> Note: This class is deprecated. Use <A HREF="#RRDFilterOp">RRDFilterOp</A> instead.</P> +<P> This class filters out a subset of DSs from an RRD identified by index or name. </P> <P>This class implements the following methods:</P> <DIV ALIGN=RIGHT> <TABLE WIDTH=90% BORDER=1 CELLPADDING=2 CELLSPACING=3> @@ -399,43 +431,14 @@ </TR> </TBODY> </TABLE> -</DIV> -<HR> -<H2 CLASS="heading-2-western"><A NAME="RRDRRAFilterAvg"></A>Class RRDRRAFilterAvg</H2> -<P>This class creates new RRAs (based on original RRAs in the RRD File) that have different time steps. This is useful for creating new RRA graphs with different time steps without actually creating and filling new RRAs. +</DIV> + +<H2 CLASS="heading-2-western"><A NAME="RRAFilterShift"></A>Class RRAFilterShift</H2> +<P>This class creates new, time-shifted RRAs. Originally developed for timezone shifting. Currently to be considered deprecated. <P>Arguments: <UL><LI>1. The RRD File -<LI>2. List of Filter Objects. Each object must instantiate getIdx, which returns the index of the RRA to use in the RRD File, and getStep, which returns the step size of the RRA. (If getStep returns null, the filter will use the original step size given by the RRA specified by getIdx). </UL> -<P>Examples of RRA Filter Objects: </P> -<PRE> - //This RRA Filter object leaves the original RRA unchanged. - function RRAIdentity(rra_idx) { - this.getIdx = function() {return rra_idx;} - this.getStep = function() {return null;} - } - - /* This Filter creates a new RRA with a different step size - / based on another RRA, whose data the new RRA averages. - / rra_idx should be index of RRA with largest step size - / that doesn't exceed new step size. */ - - function RRA_Avg(rra_idx,new_step_in_seconds) { - this.getIdx = function() {return rra_idx;} - this.getStep = function() {return new_step_in_seconds;} - } -</PRE> -<P>For instance, if you have 3 RRAs with 5 second, 60 second and 3600 second intervals, and would like an RRA with 1800 second steps along with them, create: -<PRE> - object_list = [new RRAIdentity(0), new RRAIdentity(1), new RRAItentity(2), new RRA_Avg(1,1800)]. - new RRDRRAFilterAvg(rrd_file, object_list); -</PRE> -<P>It's best to use the RRA with the next smallest step size as a basis. It's also best to make steps integer multiples of the original RRA step sizes. For instance, using a 45 minute step, a 6 hour (= 45mins x 8) step would be better than 4 hour step (=45 mins x 5.33...). -<P>Given that the above classes are likely the most useful ones, the user can use an integer instead of a RRAIdentity object, - and an Array(2) instead of the RRA_Avg object:</P> -<PRE> - object_list = [0,1,2,[1,1800]] - new RRDRRAFilterAvg(rrd_file, object_list); -</PRE> +<LI>2. Shift Int - the number of seconds to shift by (1 hour = 3600s). +<LI>3. RRA index List - A list of the RRAs (by their indicies) to be shifted; usually all RRAs in the File are included. </UL> <P>This class implements the following methods:</P> <DIV ALIGN=RIGHT> @@ -535,7 +538,6 @@ </TABLE> </DIV> - <HR> <H3 CLASS="heading-2-western">Internal Methods for Developers</H3> <H4> For RRDFilterDS: </H4> |