--- trunk/scripts/dbi-indexer.pl 2006/05/10 21:09:05 145 +++ trunk/scripts/dbi-indexer.pl 2006/05/10 21:33:32 146 @@ -5,6 +5,7 @@ use DBI; use Data::Dumper; use Encode qw/from_to/; +use Time::HiRes qw/time/; =head1 NAME @@ -43,6 +44,8 @@ my $total = $sth->rows; my $i = 1; +my $t = time(); + while (my $row = $sth->fetchrow_hashref() ) { warn "# row: ",Dumper($row) if ($c->{debug}); @@ -73,9 +76,10 @@ } - print " ", int(( $i++ / $total) * 100), "%\n"; - warn "# doc draft: ",$doc->dump_draft, "\n" if ($c->{debug}); die "error: ", $node->status,"\n" unless (eval { $node->put_doc($doc) }); + + printf (" %d%% %.1f/s\n", int(( $i++ / $total) * 100), ( $i / (time() - $t) ) ); + }