Add sums per month to HostStats.
Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
ea493f3da0
commit
c6346470f9
|
@ -107,7 +107,9 @@ if ($OptNames) {
|
||||||
}
|
}
|
||||||
|
|
||||||
### build SQL WHERE clause
|
### build SQL WHERE clause
|
||||||
|
my $ExcludeSums = $OptSums ? '' : sprintf("%s != 'ALL'",$OptType);
|
||||||
my $SQLWhereClause = SQLBuildClause('where',$SQLWherePeriod,$SQLWhereNames,
|
my $SQLWhereClause = SQLBuildClause('where',$SQLWherePeriod,$SQLWhereNames,
|
||||||
|
$ExcludeSums,
|
||||||
&SQLSetBounds('default',$LowBound,$UppBound));
|
&SQLSetBounds('default',$LowBound,$UppBound));
|
||||||
|
|
||||||
### get sort order and build SQL 'ORDER BY' clause
|
### get sort order and build SQL 'ORDER BY' clause
|
||||||
|
@ -304,6 +306,11 @@ example
|
||||||
|
|
||||||
eternal-september.org:solani.org:*.inka.de
|
eternal-september.org:solani.org:*.inka.de
|
||||||
|
|
||||||
|
=item B<-s>, B<--sums|--nosums> (sum per month)
|
||||||
|
|
||||||
|
Include a "virtual" host named "ALL" for every month in output,
|
||||||
|
containing the sum of all detected hosts for that month.
|
||||||
|
|
||||||
=item B<-r>, B<--report> I<default|sums>
|
=item B<-r>, B<--report> I<default|sums>
|
||||||
|
|
||||||
Choose the report type: I<default> or I<sums>
|
Choose the report type: I<default> or I<sums>
|
||||||
|
|
|
@ -350,6 +350,7 @@ sub HostStats {
|
||||||
# count host
|
# count host
|
||||||
if ($Host) {
|
if ($Host) {
|
||||||
$Postings{$Host}++;
|
$Postings{$Host}++;
|
||||||
|
$Postings{'ALL'}++;
|
||||||
} else {
|
} else {
|
||||||
&Bleat(2,sprintf("%s FAILED", $Header{'message-id'})) if !$Host;
|
&Bleat(2,sprintf("%s FAILED", $Header{'message-id'})) if !$Host;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +439,7 @@ override that default through the B<--groupsdb> option.
|
||||||
|
|
||||||
B<gatherstats> will examine Injection-Info:, X-Trace: and Path:
|
B<gatherstats> will examine Injection-Info:, X-Trace: and Path:
|
||||||
headers and try to normalize them. Groups not in I<TLH> will be
|
headers and try to normalize them. Groups not in I<TLH> will be
|
||||||
ignored.
|
ignored. The sum of all detected hosts will also saved for each month.
|
||||||
|
|
||||||
Data is written to I<DBTableHosts> (see L<doc/INSTALL>); you can
|
Data is written to I<DBTableHosts> (see L<doc/INSTALL>); you can
|
||||||
override that default through the B<--hostsdb> option.
|
override that default through the B<--hostsdb> option.
|
||||||
|
|
Loading…
Reference in a new issue