[PerlWikiBot] SF.net SVN: perlwikibot:[48] trunk/no-interwiki/prepare_noiw_list.pl
Status: Pre-Alpha
Brought to you by:
rotemliss
From: <am...@us...> - 2008-07-30 16:18:49
|
Revision: 48 http://perlwikibot.svn.sourceforge.net/perlwikibot/?rev=48&view=rev Author: amire80 Date: 2008-07-30 16:18:57 +0000 (Wed, 30 Jul 2008) Log Message: ----------- Started refactoring statistics. Modified Paths: -------------- trunk/no-interwiki/prepare_noiw_list.pl Modified: trunk/no-interwiki/prepare_noiw_list.pl =================================================================== --- trunk/no-interwiki/prepare_noiw_list.pl 2008-07-30 16:14:36 UTC (rev 47) +++ trunk/no-interwiki/prepare_noiw_list.pl 2008-07-30 16:18:57 UTC (rev 48) @@ -328,35 +328,9 @@ my $begin_time = time; find_iwless(); my $total_time = time - $begin_time; -say "total time: $total_time"; -INFO("\nSUMMARY"); -foreach my $stat_type (sort keys %statistics) { - if (not ref $statistics{$stat_type}) { - INFO("$stat_type: $statistics{$stat_type}"); - } -} +print_stats(); -my $max_iw_index = $#{ $statistics{count_iw} }; -INFO("max_iw_index: $max_iw_index"); -for my $max_iw_place (0 .. $option{max_iw_places}) { - my @links = - map { make_link($_) } @{ $statistics{count_iw}->[$max_iw_index] }; - INFO("# $max_iw_index: " . join_links(\@links, 0)); - - # Do nothing, just count down to the next index with a defined list - while (not defined $statistics{count_iw}->[ --$max_iw_index ]) { } -} - -INFO("\nNAMESPACES"); -foreach my $namespace (sort keys %namespace_count) { - INFO("$namespace: $namespace_count{$namespace}"); -} -INFO("\nTYPES"); -foreach my $type (sort keys %type_count) { - INFO("$type: $type_count{$type}"); -} - create_no_iw_pages(); INFO(q{}); @@ -1174,6 +1148,38 @@ return join $link_sep, @{$links_ref}; } +sub print_stats { + INFO("\nSUMMARY"); + say "total time: $total_time"; + foreach my $stat_type (sort keys %statistics) { + if (not ref $statistics{$stat_type}) { + INFO("$stat_type: $statistics{$stat_type}"); + } + } + + my $max_iw_index = $#{ $statistics{count_iw} }; + INFO("max_iw_index: $max_iw_index"); + for my $max_iw_place (0 .. $option{max_iw_places}) { + my @links = + map { make_link($_) } @{ $statistics{count_iw}->[$max_iw_index] }; + INFO("# $max_iw_index: " . join_links(\@links, 0)); + + # Do nothing, just count down to the next index with a defined list + while (not defined $statistics{count_iw}->[ --$max_iw_index ]) { } + } + + INFO("\nNAMESPACES"); + foreach my $namespace (sort keys %namespace_count) { + INFO("$namespace: $namespace_count{$namespace}"); + } + INFO("\nTYPES"); + foreach my $type (sort keys %type_count) { + INFO("$type: $type_count{$type}"); + } + + return; +} + __END__ =head1 NAME This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |