--- a/mail2db Mon Jul 21 12:56:37 2008 +0000
+++ b/mail2db Tue Jul 22 09:08:21 2008 +0000
@@ -3,6 +3,13 @@
# $Id$
# $URL$
+my ($T0, $T1);
+
+BEGIN {
+ use Time::HiRes qw(gettimeofday tv_interval);
+ $T0 = [ gettimeofday() ];
+}
+
use strict;
use warnings;
use Getopt::Long;
@@ -16,7 +23,7 @@
use Time::HiRes qw(gettimeofday tv_interval);
use if $ENV{DEBUG} => "Data::Dumper";
-my $T0 = [ gettimeofday() ];
+$T1 = [ gettimeofday() ];
my $OUTPUT_CHARSET = "UTF8";
my $DEFAULT_INPUT_CHARSET = "ASCII";
@@ -134,7 +141,7 @@
}
$DBH->commit if not $opt_dry;
- syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs)", tv_interval($T0) );
+ syslog( LOG_NOTICE, "inserted message $msg_id (%.1fs / %.1fs)", tv_interval($T0), tv_interval($T1) );
}
@@ -289,6 +296,9 @@
"DEBUG". Errors are logged as "ERR", and warnings as "WARNING". If standard
input is connected to a terminal, additional logging goes to STDERR.
+Normally just a single line is logged, containing the id of the inserted message
+and two times - the full runtime and the runtime after loading the modules.
+
=head1 DATABASE LAYOUT
Beside having transactions and real support for foreign keys, the