/[Frey]/trunk/lib/Frey/Shell/sar.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Shell/sar.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 877 by dpavlin, Thu Dec 18 13:03:42 2008 UTC revision 1133 by dpavlin, Tue Jun 30 15:10:55 2009 UTC
# Line 3  use Moose; Line 3  use Moose;
3    
4  extends 'Frey';  extends 'Frey';
5  with 'Frey::Web';  with 'Frey::Web';
 #with 'Frey::Storage';  
6    
7  has sar_command => (  has sar_command => (
8          is => 'rw',          is => 'rw',
# Line 25  sub as_sponge { Line 24  sub as_sponge {
24          my $cmd = $self->sar_command . ' ' . $opts;          my $cmd = $self->sar_command . ' ' . $opts;
25          warn "# cmd: $cmd";          warn "# cmd: $cmd";
26    
27          my $date = '1970-01-01T';          my $date = '1970-01-01 ';
28    
29          open(my $fh, '-|', $cmd) || die "can't open pipe to $cmd $!";          open(my $fh, '-|', $cmd) || die "can't open pipe to $cmd $!";
30          while(<$fh>) {          while(<$fh>) {
31                  chomp;                  chomp;
32    
33                  if ( m{(\d\d)/(\d\d)/(\d\d\d\d)$} ) {                  if ( m{(\d\d)/(\d\d)/(\d\d\d\d)$} ) {
34                          $date = "$3-$1-$2T";                          $date = "$3-$1-$2 ";
35                          warn "# date $date";                          warn "# date $date";
36                          next;                          next;
37                  }                  }
# Line 81  sub as_sponge { Line 80  sub as_sponge {
80          }          }
81    
82          return {          return {
83                    table => 'sar',
84                  rows => \@rows,                  rows => \@rows,
85                  NAME => \@name,                  NAME => \@name,
86                    sar_command => $cmd,
87          }          }
88  }  }
89    
90    __PACKAGE__->meta->make_immutable;
91    no Moose;
92    
93  1;  1;

Legend:
Removed from v.877  
changed lines
  Added in v.1133

  ViewVC Help
Powered by ViewVC 1.1.26