略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: rrd_update

2024-12-21

rrd_update

(PECL rrd >= 0.9.0)

rrd_updateUpdates the RRD database

说明

rrd_update(string $filename, array $options): bool

Updates the RRD database file. The input data is time interpolated according to the properties of the RRD database file.

参数

filename

RRD database file name. This database will be updated.

options

Options for updating the RRD database. This is list of strings. See man page of rrd update for whole list of options.

返回值

成功时返回 true, 或者在失败时返回 false

add a noteadd a note

User Contributed Notes 1 note

up
1
m[dot]reza[dot]hamedany[at]gmail[dot]com
4 years ago
class rrdUpdate {

    public function rrdFilesUpdate($id,$value){

        $rrdFile ="/path/to/file/".$id.rrd;

        $time = time();

            $ret = rrd_update($rrdFile, "$time:$value");
            return $ret;
            if (!$ret) {
                echo "<b>update error: </b>" . rrd_error() . "\n";
            }
        }
    }

官方地址:https://www.php.net/manual/en/function.rrd-update.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3