+ Enhanced code java memory-detailed
This commit is contained in:
parent
1764f49a34
commit
e1165820a4
|
@ -35,13 +35,13 @@ my %mapping_memory = (
|
||||||
'CMS Perm Gen' => 'permanent',
|
'CMS Perm Gen' => 'permanent',
|
||||||
'PS Perm Gen' => 'permanent',
|
'PS Perm Gen' => 'permanent',
|
||||||
'Perm Gen' => 'permanent',
|
'Perm Gen' => 'permanent',
|
||||||
|
'Metaspace' => 'permanent',
|
||||||
'Code Cache' => 'code',
|
'Code Cache' => 'code',
|
||||||
'CMS Old Gen' => 'tenured',
|
'CMS Old Gen' => 'tenured',
|
||||||
'PS Old Gen' => 'tenured',
|
'PS Old Gen' => 'tenured',
|
||||||
'Tenured Gen' => 'tenured',
|
'Tenured Gen' => 'tenured',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
|
@ -94,6 +94,12 @@ sub run {
|
||||||
foreach my $key (keys %$result) {
|
foreach my $key (keys %$result) {
|
||||||
$key =~ /name=(.*?),type/;
|
$key =~ /name=(.*?),type/;
|
||||||
my $memtype = $1;
|
my $memtype = $1;
|
||||||
|
|
||||||
|
if (!defined($mapping_memory{$memtype})) {
|
||||||
|
$self->{output}->output_add(long_msg => "unknown memory type: " . $memtype, debug => 1);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
my $prct = $result->{"java.lang:name=".$memtype.",type=MemoryPool"}->{Usage}->{used} / $result->{"java.lang:name=".$memtype.",type=MemoryPool"}->{Usage}->{max} * 100;
|
my $prct = $result->{"java.lang:name=".$memtype.",type=MemoryPool"}->{Usage}->{used} / $result->{"java.lang:name=".$memtype.",type=MemoryPool"}->{Usage}->{max} * 100;
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => $mapping_memory{$memtype}, unit => 'B',
|
$self->{output}->perfdata_add(label => $mapping_memory{$memtype}, unit => 'B',
|
||||||
|
|
Loading…
Reference in New Issue