From 807b791ebf74d8c955ea4919ffd93f0c4457f037 Mon Sep 17 00:00:00 2001 From: Igor Sfiligoi Date: Thu, 7 Nov 2013 22:18:18 +0000 Subject: Document the new shortcuts --- doc/lib/rrdFilter_js.html | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/doc/lib/rrdFilter_js.html b/doc/lib/rrdFilter_js.html index aa15673..5738675 100644 --- a/doc/lib/rrdFilter_js.html +++ b/doc/lib/rrdFilter_js.html @@ -52,6 +52,7 @@

Internal classes for Developers, Listed at the End:

+ +

This class filters all of the DSs in an RRD by a list of filter objects.

  The filter object must implement the following interface
    getName()               - Symbolic name give to this function
@@ -170,9 +172,9 @@
    computeResult(val_list) - val_list contains the values of the requested DSs (in the same order) 
 
  Example classes that implement the interface:
-   function DoNothing(ds_name) { //Leaves the DS alone.
+   function Itentity(ds_name) { //Leaves the DS alone.
      this.getName = function() {return ds_name;}
-     this.getDSNames = function() {return [ds1_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.
@@ -184,8 +186,14 @@
  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 DoNothing(ds0_name), 
-                     DoNothing(ds1_name), sumDS(ds0_name, ds1_name]);
+ rrd_data = new RRDFilterOp(rrd_data, [new Identity(ds0_name), 
+                     new Itentity(ds1_name), new sumDS(ds0_name, ds1_name]);
+
+

If a string is passed, it is assumed to be the name of a DS, and the Identity transformation is applied.
+ If an integer is passed, it is assumed to be the index or a DS, and the Identity equivalent is applied.
+ So this gives an equivalent result:

+
+ rrd_data = new RRDFilterOp(rrd_data, [ds0_name,1, new sumDS(ds0_name, ds1_name]);
 

Its arguments are: rrd_file and op_obj_list (list of ds filters).

This class implements the following methods:

@@ -289,7 +297,7 @@

RRA Filters:

Class RRAFilterShift

-

This class creates new, time-shifted RRAs. Originally developed for timezone shifting. +

This class creates new, time-shifted RRAs. Originally developed for timezone shifting. Currently to be considered deprecated.

Arguments: