From 3f62972e9c6f2c307e1a32c18de36860c47cffa2 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 31 Oct 2007 16:42:13 +0000 Subject: [PATCH] Support for implementation names. --- lib/ZOOM/IRSpy/Stats.pm | 18 ++++++++++++++++-- web/htdocs/details/stats.mc | 5 ++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/ZOOM/IRSpy/Stats.pm b/lib/ZOOM/IRSpy/Stats.pm index 0058e75..af667dc 100644 --- a/lib/ZOOM/IRSpy/Stats.pm +++ b/lib/ZOOM/IRSpy/Stats.pm @@ -1,4 +1,4 @@ -# $Id: Stats.pm,v 1.6 2007-01-24 09:28:02 mike Exp $ +# $Id: Stats.pm,v 1.7 2007-10-31 16:42:13 mike Exp $ package ZOOM::IRSpy::Stats; @@ -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}); + } } diff --git a/web/htdocs/details/stats.mc b/web/htdocs/details/stats.mc index fa9b652..e5db7eb 100644 --- a/web/htdocs/details/stats.mc +++ b/web/htdocs/details/stats.mc @@ -1,4 +1,4 @@ -%# $Id: stats.mc,v 1.6 2007-01-24 09:28:02 mike Exp $ +%# $Id: stats.mc,v 1.7 2007-10-31 16:42:26 mike Exp $ <%doc> Here are the headings in the Z-Spy version: The ten most commonly supported Bib-1 Use attributes @@ -55,6 +55,9 @@ if (!defined $stats || $reload) { <& table, stats => $stats, data => "domains", title => "Top Domains", headings => [ "Top Domain"] &> +<& table, stats => $stats, data => "implementation", + title => "Implementation", + headings => [ "Name" ] &> %# %# <%def table> -- 1.7.10.4