X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=doc%2Frrdruby.pod;h=c1c246e6030353d320cbbec1342444dea5c08e91;hp=f2aced8248639e7485ebeb7367d67aa475362469;hb=3501907ea29f921eefcae6bd50c3f31eca0e49b2;hpb=c0bc3b8510c95f9a0047b22070d354abf7da20b6 diff --git a/doc/rrdruby.pod b/doc/rrdruby.pod index f2aced8..c1c246e 100644 --- a/doc/rrdruby.pod +++ b/doc/rrdruby.pod @@ -7,9 +7,8 @@ rrdruby - About the RRD Ruby bindings require "RRD" RRD.create( rrd, - "--start", "#{start - 1}", "--step", "300", - "DS:a:GAUGE:600:U:U", + "DS:a:GAUGE:600:U:U", "DS:b:GAUGE:600:U:U", "RRA:AVERAGE:0.5:1:300") @@ -26,6 +25,11 @@ to the other B documentation for functions and valid arguments. $: << '/path/to/rrdtool/lib/ruby/1.8/i386-linux' require "RRD" + + name = "test" + rrd = "#{name}.rrd" + start = Time.now.to_i + RRD.create( rrd, "--start", "#{start - 1}", @@ -42,7 +46,7 @@ to the other B documentation for functions and valid arguments. 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 @@ -65,9 +69,9 @@ to the other B documentation for functions and valid arguments. puts If you use the B<--ruby-site-install> configure option you can drop the $: -line since the rrdtool module will be found automatically. +line since the RRDtool module will be found automatically. -If rrdtool runs into trouble, it will throw an exception which you might +If RRDtool runs into trouble, it will throw an exception which you might want to catch. =head1 SEE ALSO