index 6021f5d47605cfa85a82412a04ded015ab55ec80..cafb0f5613ca1e67b1f2a293d33cc47a3ed9a1cf 100755 (executable)
#! @PERL@
-#makes things work when run without install
-use lib qw( ../bindings/perl-piped/blib/lib ../lib/perl );
-
-#makes programm work AFTER install
use lib qw( @prefix@/lib/perl );
use RRDp;
$RUNS = 12*24*30*6;
$GRUNS = 20;
$RRD = "piped-demo.rrd";
-$GIF = "piped-demo.gif";
+$SVG = "piped-demo.svg";
$PNG = "piped-demo.png";
# some magic to find the correct rrdtol executable
-if ( -x "@prefix@/bin/rrdtool") {
- RRDp::start "@prefix@/bin/rrdtool";
-} elsif ( -x "../bin/rrdtool") {
- RRDp::start "../bin/rrdtool";
+$prefix="@prefix@";
+
+if ( -x "@exec_prefix@/bin/rrdtool") {
+ RRDp::start "@exec_prefix@/bin/rrdtool";
+} elsif ( -x "../../../bin/rrdtool") {
+ RRDp::start "../../../bin/rrdtool";
} else {
RRDp::start "../src/rrdtool";
}
print "\n";
# creating some graphs
-print "* Creating $GRUNS GIF graphs: $GIF\n\n";
+print "* Creating $GRUNS SVG graphs: $SVG\n\n";
$now = time;
+$localtime = scalar localtime(time);
+$localtime = s/:/\\:/g;
for ($i=0;$i<$GRUNS;$i++) {
-RRDp::cmd "graph $GIF ", "--title 'Test GRAPH' ",
- "--height 150 --vertical-label 'Dummy Units' ".
+RRDp::cmd "graph $SVG ", "--title 'Test GRAPH' ",
+ "--imgformat SVG --height 150 --vertical-label 'Dummy Units' ".
"--start now".(-$RUNS*$STEP),
"--color ARROW#bfbfbf",
"DEF:alpha=$RRD:in:AVERAGE",
"GPRINT:calc:MAX:'Max calc\\: %1.2lf %S'",
"VRULE:".($now-3600)."#008877:'60 Minutes ago'",
"COMMENT:'\\s'",
- "COMMENT:'Graph created on: ".localtime(time())."\\c'";
+ "COMMENT:'Graph created on\\: ".$localtime."\\c'";
$answer = RRDp::read;
}
$now = time;
($user1,$sys1,$real1) = ($RRDp::user,$RRDp::sys,$RRDp::real);
+my $local = "".localtime(time());
+$local =~ s/:/\\:/g;
+
for ($i=0;$i<$GRUNS;$i++) {
RRDp::cmd "graph $PNG ", "--title 'Test GRAPH' ",
"--imgformat PNG --height 150 --vertical-label 'Dummy Units' ".
"GPRINT:calc:MAX:'Max calc\\: %1.2lf %S'",
"VRULE:".($now-3600)."#008877:'60 Minutes ago'",
"COMMENT:'\\s'",
- "COMMENT:'Graph created on: ".localtime(time())."\\c'";
+ "COMMENT:'Graph created on\\: $local\\c'";
$answer = RRDp::read;
}