From 47dc8300b16581a494254807afc49da272c83a7c Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <art1@andreas-romeyke.de> Date: Thu, 8 Oct 2020 16:04:24 +0200 Subject: [PATCH] - removed unused module - add duration - add dir size - removed superflous ready message (flooding report) --- deep_fixitycheck.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deep_fixitycheck.pl b/deep_fixitycheck.pl index b2be16a..99a3814 100644 --- a/deep_fixitycheck.pl +++ b/deep_fixitycheck.pl @@ -23,7 +23,6 @@ use feature qw(say); use Carp; use Path::Tiny; use File::Find; -use File::Sort qw(sort_file); use XML::LibXML; use Time::Progress; use XML::LibXML::XPathContext; @@ -296,6 +295,7 @@ if (defined $search_dir && -d "$search_dir") { $stat->{IEs} = 0; $stat->{files} = 0; $stat->{errors} = 0; + $stat->{begin} = time; while ( <$fh_unsorted_file>) { $stat->{IEs}++; chomp; @@ -319,14 +319,17 @@ if (defined $search_dir && -d "$search_dir") { path($report_file)->append_utf8("\t$errors\n"); } $stat->{errors} += $result->{errors}; - } else { - path($report_file)->append_utf8("IE $_ is fine! :)\n"); } } # write report } say ""; - say "Scanned $stat->{IEs} IEs with $stat->{files} files, found $stat->{errors} errors"; + $stat->{end} = time; + $stat->{duration} = $stat->{end} - $stat->{begin}; + $stat->{scansize} = `du -hs $search_dir`; + my $summary = "Scanned $stat->{IEs} IEs with $stat->{files} files ($stat->{scansize}) in $stat->{duration} seconds, found $stat->{errors} errors"; + path($report_file)->append_utf8("$summary\n"); + say $summary; } else { die "no directory given on commandline"; } -- GitLab