fixed start end time in ruby fetch and added step size -- Mike Perham mperham gmail
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 8 Nov 2007 10:16:27 +0000 (10:16 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 8 Nov 2007 10:16:27 +0000 (10:16 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1213 a5681a0c-68f1-0310-ab6d-d61299d08faa

NEWS
bindings/ruby/main.c
doc/rrdruby.pod

diff --git a/NEWS b/NEWS
index 6054e35..b1fa64b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,10 @@ Forecasting (Evan Miller)
   method. It is a drop-in replacement for HWPREDICT, and is better suited for
   data whose seasonal variations grow or shrink in proportion to the average.
 
   method. It is a drop-in replacement for HWPREDICT, and is better suited for
   data whose seasonal variations grow or shrink in proportion to the average.
 
+Misc
+----
+* ruby rrd_fetch will return step as a last property -- Mike Perham
+
 Incompatibility
 ---------------
 * If you create an RRD with the new MHWPREDICT function, the resulting rrdfile will
 Incompatibility
 ---------------
 * If you create an RRD with the new MHWPREDICT function, the resulting rrdfile will
index c5cf79e..90f883b 100644 (file)
@@ -146,11 +146,12 @@ VALUE rb_rrd_fetch(
     }
     free(raw_data);
 
     }
     free(raw_data);
 
-    result = rb_ary_new2(4);
-    rb_ary_store(result, 0, INT2FIX(start));
-    rb_ary_store(result, 1, INT2FIX(end));
+    result = rb_ary_new2(5);
+    rb_ary_store(result, 0, INT2NUM(start));
+    rb_ary_store(result, 1, INT2NUM(end));
     rb_ary_store(result, 2, names);
     rb_ary_store(result, 3, data);
     rb_ary_store(result, 2, names);
     rb_ary_store(result, 3, data);
+    rb_ary_store(result, 4, INT2FIX(step));
     return result;
 }
 
     return result;
 }
 
index 9633447..5a64793 100644 (file)
@@ -46,7 +46,7 @@ to the other B<rrdtool> documentation for functions and valid arguments.
  puts
 
  puts "fetching data from #{rrd}"
  puts
 
  puts "fetching data from #{rrd}"
- (fstart, fend, data) = RRD.fetch(rrd, "--start", start.to_s, "--end", 
+ (fstart, fend, data, step) = RRD.fetch(rrd, "--start", start.to_s, "--end", 
       (start + 300 * 300).to_s, "AVERAGE")
  puts "got #{data.length} data points from #{fstart} to #{fend}"
  puts
       (start + 300 * 300).to_s, "AVERAGE")
  puts "got #{data.length} data points from #{fstart} to #{fend}"
  puts