/[ps-trend]/ps2rrd.pl
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 /ps2rrd.pl

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

revision 9 by dpavlin, Fri Jul 17 10:34:42 2009 UTC revision 10 by dpavlin, Fri Jul 17 12:37:29 2009 UTC
# Line 20  sub count { Line 20  sub count {
20          my $file = shift;          my $file = shift;
21          open(my $fh, '<', $file) || die "$file: $!";          open(my $fh, '<', $file) || die "$file: $!";
22    
         print STDERR ".";  
   
23          my $t = mktime( 0, $5, $4, $3, $2 - 1, $1 - 1900 ) if $file =~ m{(\d\d\d\d)-(\d\d)-(\d\d)/(\d\d)(\d\d)};          my $t = mktime( 0, $5, $4, $3, $2 - 1, $1 - 1900 ) if $file =~ m{(\d\d\d\d)-(\d\d)-(\d\d)/(\d\d)(\d\d)};
24    
25          warn "# $file ", -s $file, " bytes [$t]\n" if $debug;          warn "# $file ", -s $file, " bytes [$t]\n" if $debug;
# Line 54  sub count { Line 52  sub count {
52                  my $s = c('VSZ');                  my $s = c('VSZ');
53                  if ( $s < $too_small ) {                  if ( $s < $too_small ) {
54                          $vsz->{$t}->{$veid}+= $s * 1024;                          $vsz->{$t}->{$veid}+= $s * 1024;
55                            print STDERR ".";
56                  } else {                  } else {
57                          my $cmd = c('COMMAND');                          my $cmd = c('COMMAND');
58                          $cmd =~ s{-.+$}{};                          $cmd =~ s{-.+$}{};
# Line 64  sub count { Line 63  sub count {
63                          $veid .= '-' . $cmd;                          $veid .= '-' . $cmd;
64                          $veid = substr($veid,0,16);                          $veid = substr($veid,0,16);
65                          $vsz->{$t}->{$veid}+= $s * 1024;                          $vsz->{$t}->{$veid}+= $s * 1024;
66                            print STDERR substr($cmd,0,1);
67                  }                  }
68                  $veids->{$veid}++;                  $veids->{$veid}++;
69          }          }

Legend:
Removed from v.9  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26