add jboss jmx mbean for datasource mode

The datasource mode returned an unknown status because the datasources
were in another mbean. This addition shoud not break anything.
This commit is contained in:
omercier 2020-06-30 11:16:02 +02:00
parent e38c815dc9
commit 0329aae838
1 changed files with 3 additions and 1 deletions

View File

@ -99,13 +99,15 @@ sub manage_selection {
[ { name => 'AvailableConnectionCount' }, { name => 'ConnectionCount' }, { name => 'ConnectionCreatedCount' }, { name => 'InUseConnectionCount' } ] },
{ mbean => "jboss.as:data-source=*,statistics=pool,subsystem=datasources", attributes =>
[ { name => 'AvailableCount' }, { name => 'ActiveCount' }, { name => 'CreatedCount' }, { name => 'InUseCount' } ] },
{ mbean => "jboss.as.expr:xa-data-source=*,statistics=pool,subsystem=datasources", attributes =>
[ { name => 'AvailableCount' }, { name => 'ActiveCount' }, { name => 'CreatedCount' }, { name => 'InUseCount' } ] },
];
my $result = $options{custom}->get_attributes(request => $request, nothing_quit => 1);
$self->{datasource} = {};
foreach my $key (keys %$result) {
$key =~ /(?:[:,])(?:name|data-source)=(.*?)(?:,|$)/;
$key =~ /(?:[:,])(?:name|data-source|xa-data-source)=(.*?)(?:,|$)/;
my $ds_name = $1;
$ds_name =~ s/^"(.*)"$/$1/;