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 |
|
my $use = 'VSZ'; |
20 |
|
|
21 |
GetOptions( |
GetOptions( |
22 |
'debug!' => \$debug, |
'debug!' => \$debug, |
23 |
'zoom=i' => \$zoom, |
'zoom=i' => \$zoom, |
24 |
'only-veid=i' => \$only_veid, |
'only-veid=i' => \$only_veid, |
25 |
'by-veid!' => \$by_veid, |
'by-veid!' => \$by_veid, |
26 |
'size=i' => \$too_small, |
'size=i' => \$too_small, |
27 |
|
'use=s' => \$use, |
28 |
); |
); |
29 |
|
|
30 |
|
|
68 |
next if defined $only_veid && $only_veid != $veid; |
next if defined $only_veid && $only_veid != $veid; |
69 |
$veid =~ s/^0$/_hw_0/; |
$veid =~ s/^0$/_hw_0/; |
70 |
|
|
71 |
my $s = c('VSZ'); |
my $s = c($use); |
72 |
my $cmd = c('COMMAND'); |
my $cmd = c('COMMAND'); |
73 |
if ( ! $by_veid && $cmd =~ $filter ) { |
if ( ! $by_veid && $cmd =~ $filter ) { |
74 |
|
|
107 |
my @veids = sort keys %$veids; |
my @veids = sort keys %$veids; |
108 |
warn "# veids = ",dump( @veids ); |
warn "# veids = ",dump( @veids ); |
109 |
|
|
110 |
my $rrd_file = 'ps.rrd'; |
my $rrd_file = $use . '.rrd'; |
111 |
unlink $rrd_file if -e $rrd_file; |
unlink $rrd_file if -e $rrd_file; |
112 |
|
|
113 |
my @t = sort keys %$vsz; |
my @t = sort keys %$vsz; |
134 |
source_drawtypes => [ map { $_ ? 'STACK' : 'AREA' } 0 .. $#veids ], |
source_drawtypes => [ map { $_ ? 'STACK' : 'AREA' } 0 .. $#veids ], |
135 |
periods => [ qw/hour 6hour 12hour day week month year 3years/ ], |
periods => [ qw/hour 6hour 12hour day week month year 3years/ ], |
136 |
extended_legend => 1, |
extended_legend => 1, |
137 |
title => "memory > $too_small K", |
title => "$use > $too_small K", |
138 |
width => 500 * $zoom, |
width => 500 * $zoom, |
139 |
height => 200 * $zoom, |
height => 200 * $zoom, |
140 |
); |
); |