X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Fstats.mc;h=e50f56ae2b7fc32b5bb46702753dce65c41d97cc;hp=c01c302389693de990641d595e6f3e070083f5c3;hb=181c7f05d47d4abea62618b3b6d24b2298585247;hpb=e76987b5cd1a49c71ded5d7169b52162a5e2c371 diff --git a/web/htdocs/details/stats.mc b/web/htdocs/details/stats.mc index c01c302..e50f56a 100644 --- a/web/htdocs/details/stats.mc +++ b/web/htdocs/details/stats.mc @@ -1,4 +1,3 @@ -%# $Id: stats.mc,v 1.9 2007-11-02 12:49:28 mike Exp $ <%doc> Here are the headings in the Z-Spy version: The ten most commonly supported Bib-1 Use attributes @@ -27,7 +26,8 @@ my $from_cache = 1; my $stats = $m->cache->get($key); if (!defined $stats || $reload) { $from_cache = 0; - $stats = new ZOOM::IRSpy::Stats("localhost:8018/IR-Explain---1", $query); + my $db = ZOOM::IRSpy::connect_to_registry(); + $stats = new ZOOM::IRSpy::Stats($db, $query); $m->cache->set($key, $stats, "1 day"); } @@ -40,12 +40,12 @@ if (!defined $stats || $reload) {

Recalculating stats

% } <& table, stats => $stats, data => "bib1AccessPoints", - title => "The ten most commonly supported Bib-1 Use attributes", - headings => [ "Attribute", "Name"], + title => "The twenty most commonly supported Bib-1 Use attributes", + headings => [ "Attribute", "Name"], maxrows => 20, col3 => sub { bib1_access_point(@_) } &> <& table, stats => $stats, data => "recordSyntaxes", title => "Record syntax support by database", - headings => [ "Record Syntax"] &> + headings => [ "Record Syntax"], maxrows => 30 &> <& table, stats => $stats, data => "explain", title => "Explain Support", headings => [ "Explain Category"] &> @@ -83,7 +83,7 @@ $col3 => undef my $hr; $hr = $stats->{$data}; my @sorted = sort { $hr->{$b} <=> $hr->{$a} || $a <=> $b } keys %$hr; -my $n = @sorted; $n = $maxrows if @sorted > 10; +my $n = @sorted; $n = $maxrows if @sorted > 10 && $n > $maxrows; foreach my $i (1..$n) { my $key = $sorted[$i-1];