Whisper - Handle Whisper fixed-size database files
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);
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.
By default, use Whisper exports all the functions listed below.
use Whisper
path Simple string file path
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 } ], };
path Simple string file path from epoch timestamp, defaults to oldest timepoint in archive until epoch timestamp, defaults to now
Returns a hash refrence with data points and meta data for the given range:
{ 'step' => 300, 'until' => 1374830700, 'from' => 1374830100, 'values' => [ '0.000000', '1.000000' ], 'cnt' => 2 };
Original Copyright 2008 Orbitz WorldWide (python) Perl port 2013 Jean Stebens (perl)
To install Whisper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Whisper
CPAN shell
perl -MCPAN -e shell install Whisper
For more information on module installation, please visit the detailed CPAN module installation guide.