IT. Expert System.

PHP

OOP PECL/rrd example


OOP PECL/rrd example

Example #1 OO usage of rrd

<?php
$rrdFile 
dirname(__FILE__) . "/speed.rrd";
$outputPngFile dirname(__FILE__) . "/speed.png";

$creator = new RRDCreator($rrdFile"now -10d"500);
$creator->addDataSource("speed:COUNTER:600:U:U");
$creator->addArchive("AVERAGE:0.5:1:24");
$creator->addArchive("AVERAGE:0.5:6:10");
$creator->save();

$updater = new RRDUpdater($rrdFile);
$updater->update(array("speed" => "12345"), "920804700");
$updater->update(array("speed" => "12357"), "920805000");

$graphObj = new RRDGraph($outputPngFile);
$graphObj->setOptions(
    array(
        
"--start" => "920804400",
        
"--end" => 920808000,
        
"--vertical-label" => "m/s",
        
"DEF:myspeed=$rrdFile:speed:AVERAGE",
        
"CDEF:realspeed=myspeed,1000,*",
        
"LINE2:realspeed#FF0000"
    
)
);
$graphObj->save();
?>



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1744 / . Delta: 0.04540 с