[rrd-developers] corrections to the RRDs::fetch example

steve rader rader at teak.wiscnet.net
Thu Jan 13 18:51:18 MET 2000


Hey,

The pod example of RRDs::fetch is broken in a number of
places.  The details are left as an exercise for the reader.
But a fix/patch is enclosed.

later
steve
- - -
systems guy
wiscnet.net

- - - cut here - - - 
--- rrdtool-1.0.10/perl-shared/RRDs.pm.orig     Fri Jan  7 02:43:38 2000
+++ rrdtool-1.0.10/perl-shared/RRDs.pm  Thu Jan 13 11:43:28 2000
@@ -79,19 +79,20 @@
 4 values. Two normal integers, a pointer to an array and a pointer to a
 array of pointers.
 
- my ($start,$step,$names,$data) = RRDs::fetch ... 
- print "Start:        ".localtime($start)."\n"; 
- print "Stepsize:     $step seconds\n"; 
- print "Column Names: ".join (", ", @$names)."\n";
- print "Date:\n";
- foreach my $line (@array){
-      print "".localtime($start),"   ";
-      $start += $step; 
-      foreach my $val (@line) {
-           printf "%12.1f", $val;
-      }
-      print "\n";
- }
+  my ($start,$step,$names,$data) = RRDs::fetch ... 
+  print "Start:       ", scalar localtime($start), " ($start)\n";
+  print "Step size:   $step seconds\n";
+  print "DS names:    ", join (", ", @$names)."\n";
+  print "Data points: ", $#$data + 1, "\n";
+  print "Data:\n";
+  foreach my $line (@$data) {
+    print "  ", scalar localtime($start), " ($start) ";
+    $start += $step;
+    foreach my $val (@$line) {
+      printf "%12.1f ", $val;
+    }
+    print "\n";
+  }
 
 See the examples directory for more ways to use this extension.
 

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers



More information about the rrd-developers mailing list