3 #makes things work when run without install
4 use lib qw( ../bindings/perl-shared/blib/lib ../bindings/perl-shared/blib/arch );
5 # this is for after install
6 use lib qw( @prefix@/lib/perl ../lib/perl );
10 my $rrd="randome.rrd";
14 RRDs::create ($rrd, "--start",$start-1, "--step",300,
16 "RRA:AVERAGE:0.5:1:300",
20 my $ERROR = RRDs::error;
21 die "$0: unable to create `$rrd': $ERROR\n" if $ERROR;
23 # dropt some data into the rrd
25 for ($t=$start; $t<$start+300*300; $t+=300){
26 RRDs::update $rrd, "$t:".(sin($t/3000)*50+50);
27 if ($ERROR = RRDs::error) {
28 die "$0: unable to update `$rrd': $ERROR\n";
32 RRDs::graph "$name.png",
33 "--title", uc($name)." Demo",
40 "DEF:a=$rrd:a:AVERAGE",
48 if ($ERROR = RRDs::error) {
49 print "ERROR: $ERROR\n";
53 print "This script has created $name.png in the current directory\n";
54 print "This demonstrates the use of the TIME and % RPN operators\n";