BuzzSaw::ReportLog - Tracks when BuzzSaw reports were last run.
This documentation refers to BuzzSaw::ReportLog version 0.11.0
use BuzzSaw::ReportLog;
my $log = BuzzSaw::ReportLog->new();
$log->set_hourly_timestamp( 'myreport' => time );
if ( $log->get_hourly_timestamp('myreport') ) { my $tstamp = $log->get_hourly_timestamp('myreport'); }
This module provides a simple interface for storing timestamps (seconds since the unix epoch) of BuzzSaw reports. The reports are split into 4 categories - hourly, daily, weekly and monthly. It is used by the BuzzSaw::Reporter module to ensure reports are not run more frequently than desired.
BuzzSaw::Reporter
The BuzzSaw project provides a suite of tools for processing log file entries. Entries in files are parsed and filtered into a set of events of interest which are stored in a database. A report generation framework is also available which makes it easy to generate regular reports regarding the events discovered.
This is a reference to a hash which is used to store the timestamps of reports which are run hourly. It cannot be set as part of the call to the new method to create a new object.
new
This is a reference to a hash which is used to store the timestamps of reports which are run daily. It cannot be set as part of the call to the new method to create a new object.
This is a reference to a hash which is used to store the timestamps of reports which are run weekly. It cannot be set as part of the call to the new method to create a new object.
This is a reference to a hash which is used to store the timestamps of reports which are run monthly. It cannot be set as part of the call to the new method to create a new object.
This is a boolean which is used to control whether or not changes should be immediately written back to the storage file. The default is false. When it is false the changes will still be written back if an explicit call is made to the store method or when the object is destroyed as it goes out of scope.
store
This is a string attribute which is used to specify the name of the file into which the timestamps should be stored. The default is /var/lib/buzzsaw/report.runlog.yaml.
/var/lib/buzzsaw/report.runlog.yaml
Creates a new BuzzSaw::ReportLog object. If the file attribute is specified and the file exists then an attempt will be made to load the stored timestamp data using YAML::Syck.
file
Returns true or false to indicate whether (or not) a timestamp has been recorded for an hourly report of this name.
Retrieves the timestamp, in seconds since the unix epoch, for an hourly report of this name.
Sets the timestamp, in seconds since the unix epoch, for an hourly report of this name. If the store_after_change attribute is set to true then the change will immediately be written back to the log file.
store_after_change
Returns true or false to indicate whether (or not) a timestamp has been recorded for an daily report of this name.
Retrieves the timestamp, in seconds since the unix epoch, for a daily report of this name.
Sets the timestamp, in seconds since the unix epoch, for a daily report of this name. If the store_after_change attribute is set to true then the change will immediately be written back to the log file.
Returns true or false to indicate whether (or not) a timestamp has been recorded for a weekly report of this name.
Retrieves the timestamp, in seconds since the unix epoch, for a weekly report of this name.
Sets the timestamp, in seconds since the unix epoch, for a weekly report of this name. If the store_after_change attribute is set to true then the change will immediately be written back to the log file.
Returns true or false to indicate whether (or not) a timestamp has been recorded for a monthly report of this name.
Retrieves the timestamp, in seconds since the unix epoch, for a monthly report of this name.
Sets the timestamp, in seconds since the unix epoch, for a monthly report of this name. If the store_after_change attribute is set to true then the change will immediately be written back to the log file.
This method can be called to write the log out to the file. It will only do something if changes have been made to any of the timestamps or if the optional force parameter is set to true. If the newly generated file is identical to the previous one then no replacement is made so that file modification times are preserved.
force
This module is powered by Moose. It uses YAML::Syck to store the log data into a file. It also uses Text::Diff to check if the file has changed so that it only has to overwrite when absolutely necessary.
BuzzSaw, BuzzSaw::Reporter, BuzzSaw::Report
This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.
ScientificLinux6
Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.
Stephen Quinney <squinney@inf.ed.ac.uk>
Copyright (C) 2012 University of Edinburgh. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install BuzzSaw::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BuzzSaw::DB
CPAN shell
perl -MCPAN -e shell install BuzzSaw::DB
For more information on module installation, please visit the detailed CPAN module installation guide.