2 Here are the headings in the Z-Spy version:
3 The ten most commonly supported Bib-1 Use attributes
4 Record syntax support by database
6 Z39.50 Protocol Services Support
10 You can see his version live at
11 http://targettest.indexdata.com/stat.php
12 Or a static local copy at ../../../archive/stats.html
14 There may be way to generate some of this information by cleverly
15 couched searchges, but it would still be necessary to trawl the
16 records in order to find all the results, so we just take the path of
17 least resistance and look at all the records by hand.
24 my $key = defined $query ? $query : "";
26 my $stats = $m->cache->get($key);
27 if (!defined $stats || $reload) {
29 my $db = ZOOM::IRSpy::connect_to_registry();
30 $stats = new ZOOM::IRSpy::Stats($db, $query);
31 $m->cache->set($key, $stats, "1 day");
34 <h2>Statistics for <% xml_encode($stats->{host}) %></h2>
35 <h3><% $stats->{n} %> targets analysed
36 <% defined $query ? "for '" . xml_encode($query) . "'" : "" %></h3>
38 <p>Reusing cached result</p>
40 <p>Recalculating stats</p>
42 <& table, stats => $stats, data => "bib1AccessPoints",
43 title => "The ten most commonly supported Bib-1 Use attributes",
44 headings => [ "Attribute", "Name"],
45 col3 => sub { bib1_access_point(@_) } &>
46 <& table, stats => $stats, data => "recordSyntaxes",
47 title => "Record syntax support by database",
48 headings => [ "Record Syntax"] &>
49 <& table, stats => $stats, data => "explain",
50 title => "Explain Support",
51 headings => [ "Explain Category"] &>
52 <& table, stats => $stats, data => "z3950_init_opt",
53 title => "Z39.50 Protocol Services Support",
54 headings => [ "Service"] &>
55 <& table, stats => $stats, data => "domains",
56 title => "Top Domains",
57 headings => [ "Top Domain"] &>
58 <& table, stats => $stats, data => "implementation",
59 title => "Implementation",
60 headings => [ "Name" ], maxrows => 20 &>
76 % foreach my $heading ("#", @headings, "# Targets") {
77 <th><% xml_encode($heading) %></th>
84 $hr = $stats->{$data};
85 my @sorted = sort { $hr->{$b} <=> $hr->{$a} || $a <=> $b } keys %$hr;
86 my $n = @sorted; $n = $maxrows if @sorted > 10;
87 foreach my $i (1..$n) {
88 my $key = $sorted[$i-1];
92 <td><% xml_encode(substr($key, 0, 54), "HUH?") %></td>
93 % if (defined $col3) {
94 <td><% xml_encode(&$col3($key), "HUH2?") %></td>
96 <td><% xml_encode($hr->{$key}, "HUH3?") . " (" .
97 int(10000*$hr->{$key}/$stats->{n})/100 . "%)" %></td>