diff options
| author | Paul Buetow <paul@buetow.org> | 2024-12-11 09:44:32 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-12-11 09:44:32 +0200 |
| commit | b4ff1a2e3e9191f94108db210c0f14bb07c39f38 (patch) | |
| tree | 5fab323af1c9195c047f27be7b92d184321fe6b2 /frontends/scripts | |
| parent | cb92ded7f113bfd930c17a23e267d15639978ff2 (diff) | |
fix foostats
Diffstat (limited to 'frontends/scripts')
| -rw-r--r-- | frontends/scripts/foostats.pl | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/frontends/scripts/foostats.pl b/frontends/scripts/foostats.pl index f07a1dd..d40e514 100644 --- a/frontends/scripts/foostats.pl +++ b/frontends/scripts/foostats.pl @@ -16,6 +16,10 @@ no warnings qw(experimental::refaliasing); # use Data::Dumper; # TODO: Blog post about this script and the new Perl features used. +# TODO NEXT: +# 1) Implement replicator +# 2) Also merge the results +# 3) Write out a nice output from each merged file package Foostats::Logreader { use Digest::SHA3 'sha3_512_base64'; @@ -49,21 +53,14 @@ package Foostats::Logreader { say 'File path glob matches: ' . join(' ', glob $glob); LAST: - for my $path (glob $glob) { + for my $path ( sort { -M $a <=> -M $b } glob $glob) { say "Processing $path"; my $file = open_file $path; my $year = year $file; - # my $fist_line_printed = false; while (<$file>) { next if contains($_, 'logfile turned over'); - # unless ($fist_line_printed) { - # # For debugging purposes. - # say "$path\'s first line:"; - # say $_; - # $fist_line_printed = true; - # } # last == true means: After this file, don't process more $last = true unless defined $cb->($year, split / +/); @@ -379,8 +376,3 @@ package main { replicate $stats_dir, $partner_node if $replicate; pretty_print $stats_dir if $pretty_print; } - -# TODO NEXT: -# 1) Implement replicator -# 2) Also merge the results -# 3) Write out a nice output from each merged file |
