[scripts] AggCheck: -n prints total nb of packets
This commit is contained in:
parent
89cf84403c
commit
935b77e114
|
@ -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";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue