/[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 14 by dpavlin, Fri Jul 17 18:35:34 2009 UTC revision 15 by dpavlin, Sun Jul 19 17:49:55 2009 UTC
# Line 12  my $debug = 0; Line 12  my $debug = 0;
12  my $zoom = 2;  my $zoom = 2;
13    
14  my $only_veid;  my $only_veid;
15    my $by_veid;
16  my $too_small = 64;     # M  my $too_small = 64;     # M
17  my $filter = qr{(apache|mysql|postgres|cgi-bin|SIP)};  my $filter = qr{(apache|mysql|postgres|cgi-bin|SIP)};
18    
19  GetOptions(  GetOptions(
20          'debug!'   => \$debug,          'debug!'   => \$debug,
21          'zoom=i'   => \$zoom,          'zoom=i'   => \$zoom,
22          'veid=i'   => \$only_veid,          'only-veid=i' => \$only_veid,
23            'by-veid!' => \$by_veid,
24          'size=i'   => \$too_small,          'size=i'   => \$too_small,
25  );  );
26    
# Line 65  sub count { Line 67  sub count {
67    
68                  my $s = c('VSZ');                  my $s = c('VSZ');
69                  my $cmd = c('COMMAND');                  my $cmd = c('COMMAND');
70                  if ( $cmd =~ $filter ) {                  if ( ! $by_veid && $cmd =~ $filter ) {
71    
72                          $veid .= '-' . $1;                          $veid .= '-' . $1;
73                          $vsz->{$t}->{$veid} += $s * 1024;                          $vsz->{$t}->{$veid} += $s * 1024;
74                          print STDERR uc(substr($1,0,1));                          print STDERR uc(substr($1,0,1));
75    
76                  } elsif ( $s < $too_small ) {                  } elsif ( $s < $too_small || $by_veid ) {
77    
78                          $vsz->{$t}->{$veid}+= $s * 1024;                          $vsz->{$t}->{$veid}+= $s * 1024;
79                          print STDERR ".";                          print STDERR ".";

Legend:
Removed from v.14  
changed lines
  Added in v.15

  ViewVC Help
Powered by ViewVC 1.1.26