예제 #1
0
파일: tests.php 프로젝트: jasherai/libwebta
 function testRRD()
 {
     $RRD = new RRD("/tmp/test.rrd");
     // Add DS
     $RRD->AddDS(new RRDDS("test", "GAUGE", 3600));
     $RRD->AddDS(new RRDDS("test2", "GAUGE", 3600));
     // Add RRA
     $RRD->AddRRA(new RRA("HWPREDICT", array(1440, 0.1, 0.0035, 288)));
     $RRD->AddRRA(new RRA("AVERAGE", array(0.5, 1, 1000)));
     $this->assertTrue($RRD->Create(0, 3600) && file_exists("/tmp/test.rrd"), "Database created.");
     $this->assertTrue($RRD->Update(array(1, 2)), "Database updated.");
 }