X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FStats.pm;h=af667dcede609315b337be1a1281a56c938dd206;hp=c7780f4b17b0ec798d235abbdd0dfb1f4be57702;hb=3f62972e9c6f2c307e1a32c18de36860c47cffa2;hpb=3cf923a1e95f0ee1972ce0483fa9059096899ba9 diff --git a/lib/ZOOM/IRSpy/Stats.pm b/lib/ZOOM/IRSpy/Stats.pm index c7780f4..af667dc 100644 --- a/lib/ZOOM/IRSpy/Stats.pm +++ b/lib/ZOOM/IRSpy/Stats.pm @@ -1,4 +1,4 @@ -# $Id: Stats.pm,v 1.5 2006-12-18 15:34:27 mike Exp $ +# $Id: Stats.pm,v 1.7 2007-10-31 16:42:13 mike Exp $ package ZOOM::IRSpy::Stats; @@ -49,7 +49,7 @@ Either one or two arguments are required: An indication of the IRSpy database that statistics are required for. This may be in the form of a C object or a -database-name string such as C. +database-name string such as C. =item $query (optional) @@ -137,7 +137,13 @@ sub _gather_stats { $this->{domains}->{$host}++; # Implementation - ### Requires XSLT fix + foreach my $node ($xc->findnodes('i:status/i:serverImplementationName/@value')) { + $this->{implementation}->{$node->findvalue(".")}++; + last; # This is because many of the records are still + # polluted with multiple implementationName elements + # from back then XSLT stylesheet that generated + # ZeeRex records was wrong. + } } } @@ -199,6 +205,14 @@ sub print { print sprintf("%-26s%5d (%d%%)\n", $key, $hr->{$key}, 100*$hr->{$key}/$this->{n}); } + + print "\nIMPLEMENTATIONS\n"; + $hr = $this->{implementation}; + foreach my $key (sort { $hr->{$b} <=> $hr->{$a} + || $a cmp $b } keys %$hr) { + print sprintf("%-26s%5d (%d%%)\n", + $key, $hr->{$key}, 100*$hr->{$key}/$this->{n}); + } }