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
if (!$rebuild || ($#logfile >= 0)) {
$sa->parseFile();
$t1 = Benchmark->new;
my $td = timediff($t1, $t0);
print STDERR "DEBUG: the log statistics gathering took:", timestr($td), "\n";
if ($debug) {
$t1 = Benchmark->new;
my $td = timediff($t1, $t0);
print STDERR "DEBUG: the log statistics gathering took:", timestr($td), "\n";
}
}
# Remove old statistics
@ -155,14 +157,16 @@ if ($rebuild) {
# Generate graphics and html
$sa->buildHTML();
my $t2 = Benchmark->new;
if (defined $t1) {
my $td = timediff($t2, $t1);
print STDERR "DEBUG: generating HTML output took:", timestr($td), "\n";
}
if ($degug) {
my $t2 = Benchmark->new;
if (defined $t1) {
my $td = timediff($t2, $t1);
print STDERR "DEBUG: generating HTML output took:", timestr($td), "\n";
}
my $td = timediff($t2, $t0);
print STDERR "DEBUG: total execution time:", timestr($td), "\n";
my $td = timediff($t2, $t0);
print STDERR "DEBUG: total execution time:", timestr($td), "\n";
}
# Remove PID file
unlink("$pid_dir/$pidfile");