"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Swatch/Throttle.pm" between
swatch-3.2.3.tar.gz and swatchdog-3.2.4.tar.gz

About: Swatchdog (Simple WATCHdog) activly monitors log files produced by UNIX’s syslog facility (former name "Swatch").

Throttle.pm  (swatch-3.2.3):Throttle.pm  (swatchdog-3.2.4)
package Swatch::Throttle; package Swatchdog::Throttle;
require 5.000; require 5.000;
require Exporter; require Exporter;
use strict; use strict;
use Carp; use Carp;
use Date::Calc; use Date::Calc;
use Date::Manip; use Date::Manip;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
skipping to change at line 59 skipping to change at line 59
my $file = shift; my $file = shift;
my $fh = new FileHandle $file, "w"; my $fh = new FileHandle $file, "w";
my $date = localtime(time); my $date = localtime(time);
if (defined $fh) { if (defined $fh) {
$fh->print(q/ $fh->print(q/
################################################################ ################################################################
# THIS FILE WAS GENERATED BY SWATCH AT $date. # THIS FILE WAS GENERATED BY SWATCH AT $date.
# DO NOT EDIT!!! # DO NOT EDIT!!!
################################################################ ################################################################
$Swatch::Throttle::LogRecords = ( $Swatchdog::Throttle::LogRecords = (
/); /);
foreach my $key ( keys %LogRecords ) { foreach my $key ( keys %LogRecords ) {
$fh->print("\t'$key' => {\n"); $fh->print("\t'$key' => {\n");
foreach my $attr ( keys %{ $LogRecords{$key} } ) { foreach my $attr ( keys %{ $LogRecords{$key} } ) {
$fh->print("\t\t$attr => "); $fh->print("\t\t$attr => ");
if ($attr =~ /FIRST|LAST|HOLD_DHMS/) { if ($attr =~ /FIRST|LAST|HOLD_DHMS/) {
$fh->print("[ "); $fh->print("[ ");
foreach my $elem (@{ $LogRecords{$key}{$attr} }) { foreach my $elem (@{ $LogRecords{$key}{$attr} }) {
$fh->print("\'$elem\', "); $fh->print("\'$elem\', ");
skipping to change at line 197 skipping to change at line 197
delete($LogRecords{$key}); delete($LogRecords{$key});
} }
} }
} }
} }
## The POD ### ## The POD ###
=head1 NAME =head1 NAME
Swatch::Throttle - Perl extension for throttling and thresholding in swatch(1) Swatchdog::Throttle - Perl extension for throttling and thresholding in swatch dog(1)
=head1 SYNOPSIS =head1 SYNOPSIS
use Swatch::Throttle; use Swatchdog::Throttle;
throttle( throttle(
extra_cuts => @array_of_regular_expressions, extra_cuts => @array_of_regular_expressions,
hold_dhms => @DHMS, hold_dhms => @DHMS,
key => 'log'|<regex>|<user defined>, key => 'log'|<regex>|<user defined>,
log_msg => <message>, log_msg => <message>,
threshold => <n>, threshold => <n>,
time_from => 'realtime'|'timestamp', time_from => 'realtime'|'timestamp',
time_regex => <regex>, time_regex => <regex>,
); );
skipping to change at line 227 skipping to change at line 227
key=log|regex|<regex> key=log|regex|<regex>
=head1 DESCRIPTION =head1 DESCRIPTION
=head1 AUTHOR =head1 AUTHOR
E. Todd Atkins, todd.atkins@stanfordalumni.org E. Todd Atkins, todd.atkins@stanfordalumni.org
=head1 SEE ALSO =head1 SEE ALSO
perl(1), swatch(1). perl(1), swatchdog(1).
=cut =cut
1; 1;
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS