Code

make sure gcc-4.0 does not optimize our tests away :-)
[rrdtool-all.git] / contrib / php3 / examples / rrd_create.php
1 <?
3  dl("/tmp/php3_rrdtool.so");
5  ##
6  ## demonstration of the rrd_create() command
7  ##
9   $_opts = array( "--step", "300", "--start", 0,
10                  "DS:input:COUNTER:900:0:U",
11                  "DS:output:COUNTER:900:0:U",
12                  "RRA:AVERAGE:0.5:1:1000",
13                  "RRA:MIN:0.5:1:1000",
14                  "RRA:MAX:0.5:1:1000"
15                );
17   $ret = rrd_create("/tmp/test.rrd", $_opts, count($_opts));
19   if ( $ret == -1 )
20   {
21       $err = rrd_error();
22       echo "Create error: $err\n";
23   }
24   /*  else rrd_create was successful  */
27 ?>