r443@llin: dpavlin | 2006-01-22 14:41:18 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 22 Jan 2006 13:38:17 +0000 (13:38 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 22 Jan 2006 13:38:17 +0000 (13:38 +0000)
 output of rec/s and elapsed time added

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@389 07558da8-63fa-0310-ba24-9fe276d99e06

run.pl

diff --git a/run.pl b/run.pl
index 5c74963..f32337d 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -17,6 +17,7 @@ use WebPAC::Output::Estraier 0.08;
 use YAML qw/LoadFile/;
 use Getopt::Long;
 use File::Path;
+use Time::HiRes qw/time/;
 
 =head1 NAME
 
@@ -76,6 +77,7 @@ print "config = ",Dumper($config) if ($debug);
 die "no databases in config file!\n" unless ($config->{databases});
 
 my $total_rows = 0;
+my $start_t = time();
 
 while (my ($database, $db_config) = each %{ $config->{databases} }) {
 
@@ -205,7 +207,12 @@ while (my ($database, $db_config) = each %{ $config->{databases} }) {
 
        };
 
-       $log->info("$total_rows records indexed");
+       my $dt = time() - $start_t;
+       $log->info("$total_rows records indexed in " .
+               sprintf("%.2f sec [%.2f rec/sec]",
+                       $dt, ($total_rows / $dt)
+               )
+       );
 
        #
        # add Hyper Estraier links to other databases