diff --git a/scripts/owlps-aggcheck.pl b/scripts/owlps-aggcheck.pl index 53bedc0..f3dffe9 100755 --- a/scripts/owlps-aggcheck.pl +++ b/scripts/owlps-aggcheck.pl @@ -44,7 +44,8 @@ Print signal strength distribution in CSV format. =item B<-n> -Print per-request statistics in CSV format. +Print per-request statistics in CSV format, as well as the total number of +packets received by each capture point. =item B<-v> @@ -251,6 +252,9 @@ while (<>) { ## Print statistics ## if ($print_stats) { + # Will contain the total number of packets received by each CP + my %total_nb_pkts; + # Print the header line my @cps_names = sort keys %global_present_cps; print "Timestamp"; @@ -261,12 +265,19 @@ if ($print_stats) { foreach my $timestamp (sort keys %global_stats) { print "$timestamp"; my $present_cps = $global_stats{$timestamp}; - # Print the CPs in the same order as in the header + # Print the CPs in the same order as in the header and count the totals foreach my $mac (@cps_names) { - print ";", ($present_cps->{$mac} or 0); + my $nb_pkts = ($present_cps->{$mac} or 0); + print ";", $nb_pkts; + $total_nb_pkts{$mac} += $nb_pkts; } print "\n"; } + + # Print the totals + print "Total"; + print ";$total_nb_pkts{$_}" foreach (@cps_names); + print "\n"; }