Fix output of benckmark info when debug is not enabled. Thanks to Juan Jose Pablos for the report.

This commit is contained in:
Darold Gilles 2015-05-21 16:33:39 +02:00
parent 0df6e96846
commit 1718b1347e
1 changed files with 14 additions and 10 deletions

View File

@ -136,9 +136,11 @@ my $t1;
# Run parsing only if we have a log file or that we are not in rebuild mode # Run parsing only if we have a log file or that we are not in rebuild mode
if (!$rebuild || ($#logfile >= 0)) { if (!$rebuild || ($#logfile >= 0)) {
$sa->parseFile(); $sa->parseFile();
$t1 = Benchmark->new; if ($debug) {
my $td = timediff($t1, $t0); $t1 = Benchmark->new;
print STDERR "DEBUG: the log statistics gathering took:", timestr($td), "\n"; my $td = timediff($t1, $t0);
print STDERR "DEBUG: the log statistics gathering took:", timestr($td), "\n";
}
} }
# Remove old statistics # Remove old statistics
@ -155,14 +157,16 @@ if ($rebuild) {
# Generate graphics and html # Generate graphics and html
$sa->buildHTML(); $sa->buildHTML();
my $t2 = Benchmark->new; if ($degug) {
if (defined $t1) { my $t2 = Benchmark->new;
my $td = timediff($t2, $t1); if (defined $t1) {
print STDERR "DEBUG: generating HTML output took:", timestr($td), "\n"; my $td = timediff($t2, $t1);
} print STDERR "DEBUG: generating HTML output took:", timestr($td), "\n";
}
my $td = timediff($t2, $t0); my $td = timediff($t2, $t0);
print STDERR "DEBUG: total execution time:", timestr($td), "\n"; print STDERR "DEBUG: total execution time:", timestr($td), "\n";
}
# Remove PID file # Remove PID file
unlink("$pid_dir/$pidfile"); unlink("$pid_dir/$pidfile");