Jean Stebens > Whisper-1.013 > Whisper

Download:
Whisper-1.013.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.013   Source   Latest Release: Whisper-1.035

NAME ^

Whisper - Handle Whisper fixed-size database files

SYNOPSIS ^

        use Whisper;

        # Read archive information
        my $info = wsp_info("/path/to/my/database.wsp"); 

        # Fetch archive data
        my $data = wsp_fetch("/path/to/my/database.wsp", $from, $until);

DESCRIPTION ^

This is a simple Whisper (fixed-size database) reader.

Whisper archive/databse files (.wsp) are similiar to RRD archive files. For more details about Whisper see http://graphite.wikidot.com/whisper

The following operations are supported:

        wsp_info        Read basic archive information
        wsp_fetch       Fetch data points from archive

These operations are planned:

        wsp_create      Create wsp database
        wsp_update      Add a data point to a wsp database
        wsp_update_bulk Add multiple data points to a wsp database
        wsp_merge       Merge two wsp database files

Feel free to help implement the above operations.

EXPORTS ^

By default, use Whisper exports all the functions listed below.

FUNCTIONS ^

wsp_info ($file)

Parameters

        path    Simple string file path

Returns

Returns a hash reference with Header/Metadata information:

        {
                'aggregationType' => 1,
                'fileSize' => 32872,
                'archiveCount' => 2,
                'xFilesFactor' => '0.5',
                'maxRetention' => 2592000

                'archives' => [
                        {
                                'secondsPerPoint' => 300,
                                'points' => 2016,
                                'retention' => 604800,
                                'size' => 24192,
                                'offset' => 40
                        },
                        {
                                'secondsPerPoint' => 3600,
                                'points' => 720,
                                'retention' => 2592000,
                                'size' => 8640,
                                'offset' => 24232
                        }
                ],
        };

wsp_fetch ($file, $from, $until)

Parameters

        path    Simple string file path 
        from    epoch timestamp, defaults to oldest timepoint in archive
        until   epoch timestamp, defaults to now

Returns

Returns a hash refrence with data points and meta data for the given range:

        {
                'step' => 300,
                'end' => 1374830700,
                'start' => 1374830100,
                'values' => [
                        '0.000000',
                        '1.000000'
                ],
                'cnt' => 2
        };

CVS ^

Current CVS: https://github.com/corecache/libwhisper-perl

COPYRIGHT AND LICENSE ^

Original Copyright 2008 Orbitz WorldWide (python) Perl port 2013 Jean Stebens (perl)

syntax highlighting: