[PATCH] libdbi

Hans Jørgen Jakobsen <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Here is a patch for libdbi access.
1) Sigma calculation had an error. The first data value in each bin 
didn't get squared.

2) "rrdfillmissing" was dummy. I have added code to do the work. The 
parameter has NOW to be in seconds. In doc it is given in steps. The 
size of steps depends to much on size of graph so I think its easier to 
use seconds and internal calculate the number of steps.

(I have mailed with Martin Sperl)
/hjj

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
p2 (text/plain, 1.2 KB)
--- rrdgraph_libdbi.pod 2010-11-10 13:55:23.000000000 +0100
+++ rrdgraph_libdbi.pod.orig    2010-11-10 13:52:38.000000000 +0100
@@ -7 +7 @@
-E<lt>rrdfileE<gt> = B<sql//E<lt>libdbi driverE<gt>/E<lt>driver-option-nameE<gt>=E<lt>driver-option-valueE<gt>/...[/rrdminstepsize=E<lt>stepsizeE<gt>][/rrdfillmissing=E<lt>fill missing n secondsE<gt>]//E<lt>tableE<gt>/E<lt>unixtimestamp columnE<gt>/E<lt>data value columnE<gt>[/derive]/E<lt>where clause 1E<gt>/.../E<lt>where clause nE<gt>>
+E<lt>rrdfileE<gt> = B<sql//E<lt>libdbi driverE<gt>/E<lt>driver-option-nameE<gt>=E<lt>driver-option-valueE<gt>/...[/rrdminstepsize=E<lt>stepsizeE<gt>][/rrdfillmissing=E<lt>fill missing n samplesE<gt>]//E<lt>tableE<gt>/E<lt>unixtimestamp columnE<gt>/E<lt>data value columnE<gt>[/derive]/E<lt>where clause 1E<gt>/.../E<lt>where clause nE<gt>>
@@ -32 +32 @@
-=item B</rrdfillmissing>=B<E<lt>fill missing secondsE<gt>>
+=item B</rrdfillmissing>=B<E<lt>fill missing stepsE<gt>>
@@ -34 +34 @@
-  defines the number of seconds to fill with the last value to avoid NaN boxes due to data-insertation jitter (default: 0 seconds)
+  defines the number of steps to fill with the last value to avoid NaN boxes due to data-insertation jitter (default: 0 steps)
p1 (text/plain, 1.1 KB)
--- rrd_fetch_libdbi.c  2010-11-10 09:24:40.000000000 +0100
+++ rrd_fetch_libdbi.c.orig     2010-04-07 15:04:33.000000000 +0200
@@ -617 +617 @@
-       (*data)[idx*(*ds_cnt)+4]=r_value*r_value; /* SIGMA */
+       (*data)[idx*(*ds_cnt)+4]=r_value; /* SIGMA */
@@ -654,24 +653,0 @@
-  /* Fill in missing values */
-  fillmissing/=(*step);/* Convert from seconds to steps */
-  if (fillmissing>0) {
-    int copy_left=fillmissing;
-    for(idx=1;idx<rows;idx++) {
-      long count=(*data)[idx*(*ds_cnt)+3];
-      if (count==0) {
-        /* No data this bin */
-        if (copy_left>0) {
-          /* But we can copy from previous */
-          int idx_p=idx-1;
-          (*data)[idx*(*ds_cnt)+0]=(*data)[idx_p*(*ds_cnt)+0];
-          (*data)[idx*(*ds_cnt)+1]=(*data)[idx_p*(*ds_cnt)+1];
-          (*data)[idx*(*ds_cnt)+2]=(*data)[idx_p*(*ds_cnt)+2];
-          (*data)[idx*(*ds_cnt)+3]=(*data)[idx_p*(*ds_cnt)+3];
-          (*data)[idx*(*ds_cnt)+4]=(*data)[idx_p*(*ds_cnt)+4];
-          copy_left--;
-        }
-      }else{
-        copy_left=fillmissing;
-      }
-    }
-  }
-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.