new issue
[andk-cpan-tools.git] / bin / m-l-smokerpt-parse.pl
blobce4c150e51eab72ebd60210e13d8ee619fd046ce
1 #!/usr/bin/perl
3 # use 5.010;
4 use strict;
5 use warnings;
7 =head1 NAME
11 =head1 SYNOPSIS
13 m-l-smokerpt-parse <filename>
15 =head1 OPTIONS
17 =over 8
19 =cut
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
23 =item B<--help|h!>
25 This help
27 =back
29 =head1 DESCRIPTION
33 =head1 BUGS
35 This is a one-off script with shortcuts.
37 =cut
40 use FindBin;
41 use lib "$FindBin::Bin/../lib";
42 BEGIN {
43 push @INC, qw( );
46 use Dumpvalue;
47 use File::Basename qw(dirname);
48 use File::Path qw(mkpath);
49 use File::Spec;
50 use File::Temp;
51 use Getopt::Long;
52 use Pod::Usage;
53 use Hash::Util qw(lock_keys);
55 our %Opt;
56 lock_keys %Opt, map { /([^=|!]+)/ } @opt;
57 GetOptions(\%Opt,
58 @opt,
59 ) or pod2usage(1);
61 my $filename = shift or pod2usage(1);
63 use YAML::Syck;
64 my $y = YAML::Syck::LoadFile($filename);
65 for my $report (sort { $y->{$a}{timestamp} cmp $y->{$b}{timestamp} } keys %$y) {
66 my $treport = $y->{$report};
67 my($avg) = $treport->{content} =~ /^ smoketime .+? \(average (.+?)\)/m;
68 printf "%s %s\n", $treport->{timestamp}, $avg;
71 # Local Variables:
72 # mode: cperl
73 # cperl-indent-level: 4
74 # End: