X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=innduct.git;a=blobdiff_plain;f=innduct-stats-report;h=62007edd97a67248bc79a65d3f36209fa7e75fb6;hp=653a8f7a1dfb6d6941c0ba60ca5216adf0205083;hb=c2ec61d4f426a04f288559c5ad50df822b7dcfb8;hpb=47015e24cbd42868bdfc7e93c5f53252d1d3925a diff --git a/innduct-stats-report b/innduct-stats-report index 653a8f7..62007ed 100755 --- a/innduct-stats-report +++ b/innduct-stats-report @@ -10,6 +10,10 @@ our %counts; # Input lines look like this: # May 23 19:00:02 chiark innduct[23236]: news.relativity.greenend.org.uk| info: completed feedfile read=76 (+bl=7,+err=0) missing=0 offered=76 (ch=76,nc=0) accepted=75 (ch=75,nc=0) unwanted=1 (id=1,bod=0,nc=0) rejected=0 (id=0,bod=0,nc=0) deferred=0 (id=0,bod=0,nc=0) missing=0 (id=0,bod=0,nc=0) connretry=0 (id=0,bod=0,nc=0) +if (@ARGV && $ARGV[0] =~ m/^\-/) { + die "$0: bad usage: no options supported\n"; +} + while (<>) { next unless m/^ [:0-9A-Za-z ]+[ ] @@ -50,13 +54,14 @@ while (<>) { die "$_ // $strs ?"; } } - + # print "$site|"; # foreach my $k (sort keys %$c) { printf " %s=%d", $k, $c->{$k}; } # print "\n"; -#print Dumper(\%counts);; } +#print STDERR Dumper(\%counts);; + our $cwr; our $site; @@ -83,12 +88,12 @@ format STDOUT_TOP = offrd acctd unwtd rejtd ac% rj% nochk nc% . format STDOUT = -@>>>> @>>>> @>>>> @>>>> ^## ^## @>>>> ^## @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +@>>>> @>>>> @>>>> @>>>> ^## ^## @>>>> ^## @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... { (map { amt($cwr->{$_}) } qw(offered accepted unwanted rejected)), (map { pct($cwr->{$_}, $cwr->{offered}) } qw(accepted rejected)), ($cwr->{offered_nc} ? (amt($cwr->{offered_nc}), pct($cwr->{offered_nc}, $cwr->{offered})) - : '',undef), - ($site); + : ('',undef)), + ($site) } .