X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=bin%2Fgatherstats.pl;h=b09b73f1f3f1c0fa4d0f17adfe1ca8bb6c52ef7e;hp=b4f07d92827d4c5c10b1717c258a9037f514d78b;hb=84e9923abeadcfb488985b9e60eb78d4eaa950fd;hpb=fd0717a15cb1b36e25a019060d3f40aac9ca9517 diff --git a/bin/gatherstats.pl b/bin/gatherstats.pl old mode 100755 new mode 100644 index b4f07d9..b09b73f --- a/bin/gatherstats.pl +++ b/bin/gatherstats.pl @@ -3,7 +3,7 @@ # gatherstats.pl # # This script will gather statistical information from a database -# containing headers and other information from a INN feed. +# containing headers and other information from an INN feed. # # It is part of the NewsStats package. # @@ -38,7 +38,7 @@ my %LegalStats; ### read commandline options my ($OptCheckgroupsFile,$OptClientsDB,$OptDebug,$OptGroupsDB,$OptTLH, - $OptHostsDB,$OptMonth,$OptRawDB,$OptStatsType,$OptTest,$OptConfFile); + $OptHostsDB,$OptMonth,$OptParseDB,$OptStatsType,$OptTest,$OptConfFile); GetOptions ('c|checkgroups=s' => \$OptCheckgroupsFile, 'clientsdb=s' => \$OptClientsDB, 'd|debug!' => \$OptDebug, @@ -46,7 +46,7 @@ GetOptions ('c|checkgroups=s' => \$OptCheckgroupsFile, 'hierarchy=s' => \$OptTLH, 'hostsdb=s' => \$OptHostsDB, 'm|month=s' => \$OptMonth, - 'rawdb=s' => \$OptRawDB, + 'parsedb=s' => \$OptParseDB, 's|stats=s' => \$OptStatsType, 't|test!' => \$OptTest, 'conffile=s' => \$OptConfFile, @@ -58,7 +58,7 @@ my %Conf = %{ReadConfig($OptConfFile)}; ### override configuration via commandline options my %ConfOverride; -$ConfOverride{'DBTableRaw'} = $OptRawDB if $OptRawDB; +$ConfOverride{'DBTableParse'} = $OptParseDB if $OptParseDB; $ConfOverride{'DBTableGrps'} = $OptGroupsDB if $OptGroupsDB; $ConfOverride{'DBTableClnts'} = $OptClientsDB if $OptClientsDB; $ConfOverride{'DBTableHosts'} = $OptHostsDB if $OptHostsDB; @@ -124,15 +124,15 @@ foreach my $Month (&ListMonth($Period)) { ### ---------------------------------------------- ### get groups data (number of postings per group) - # get groups data from raw table for given month + # get groups data from parsed table for given month my $DBQuery = $DBHandle->prepare(sprintf("SELECT newsgroups FROM %s.%s ". "WHERE day LIKE ? AND NOT disregard", $Conf{'DBDatabase'}, - $Conf{'DBTableRaw'})); + $Conf{'DBTableParse'})); $DBQuery->execute($Month.'-%') or &Bleat(2,sprintf("Can't get groups data for %s from %s.%s: ". "$DBI::errstr\n",$Month, - $Conf{'DBDatabase'},$Conf{'DBTableRaw'})); + $Conf{'DBDatabase'},$Conf{'DBTableParse'})); # count postings per group my %Postings; @@ -206,11 +206,11 @@ __END__ =head1 NAME -gatherstats - process statistical data from a raw source +gatherstats - process statistical data from a parsed source =head1 SYNOPSIS -B [B<-Vhdt>] [B<-m> I | I] [B<-s> I] [B<-c> I]] [B<--hierarchy> I] [B<--rawdb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] [B<--conffile> I] +B [B<-Vhdt>] [B<-m> I | I] [B<-s> I] [B<-c> I]] [B<--hierarchy> I] [B<--parsedb> I] [B<-groupsdb> I] [B<--clientsdb> I] [B<--hostsdb> I] [B<--conffile> I] =head1 REQUIREMENTS @@ -219,7 +219,7 @@ See L. =head1 DESCRIPTION This script will extract and process statistical information from a -database table which is fed from F for a given time period +database table which is filled from F for a given time period and write its results to (an)other database table(s). Entries marked with I<'disregard'> in the database will be ignored; currently, you have to set this flag yourself, using your database management tools. @@ -267,7 +267,7 @@ submitted by the B<--conffile> option. See L for an overview of possible configuration options. You can override configuration options via the B<--hierarchy>, -B<--rawdb>, B<--groupsdb>, B<--clientsdb> and B<--hostsdb> options, +B<--parsedb>, B<--groupsdb>, B<--clientsdb> and B<--hostsdb> options, respectively. =head1 OPTIONS @@ -328,9 +328,9 @@ will be added with a count of 0 (and logged to STDERR). Override I from F. -=item B<--rawdb> I (raw data table) +=item B<--parsedb> I
(parsed data table) -Override I from F. +Override I from F. =item B<--groupsdb> I
(postings per group table)