The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RRD::Query - Perform queries on RRD file

DESCRIPTION

Simple wrapper around RRDs library to do some simple queries. It implemented more advanced error handling by using the Error module.

CONSTRUCTOR

    my $rq = new RRD::Query("/path/to/file.rrd");

METHODS

fetch

    ($value) = fetch($ds, cf => $cf, offset => $offset)

Fetch a single value from the datasource $ds of RRD file. If $offset is omitted, the last inserted value is returned, otherwise the last value - $offset is returned. If $cf (consolidation function) is omited, AVERAGE is used.

Throws:

Error::RRDs - on RRDs library error

Error::RRD::NoSuchDS - if datasource can't be found in RRD file

get_last

    $timestamp = get_last()

Returns the timestamp of the inserted value of the RRD file.

Throws:

Error::RRDs - on RRDs library error

EXPORTS

isNaN

    $bool = isNaN($value);

Returns true if the value is Not a Number.

EXCEPTION CLASSES

Error::RRDs

Error::RRD::NoSuchDS

Error::RRD::isNaN

AUTHOR

Olivier Poitrey <rs@rhapsodyk.net>

LICENCE

RRD::Query, performs queries on RRD files. Copyright (C) 2004 Olivier Poitrey

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

SEE ALSO

RRDs, Error