enhance jboss datasource usage
This commit is contained in:
parent
95a964b09a
commit
26c46c2649
|
@ -36,46 +36,42 @@ sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{maps_counters_type} = [
|
$self->{maps_counters_type} = [
|
||||||
{ name => 'datasource', type => 1, cb_prefix_output => 'prefix_ds_output', message_multiple => 'All datasources are ok' },
|
{ name => 'datasource', type => 1, cb_prefix_output => 'prefix_ds_output', message_multiple => 'All datasources are ok' }
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{datasource} = [
|
$self->{maps_counters}->{datasource} = [
|
||||||
{ label => 'active-con', nlabel => 'datasource.connections.active.count', set => {
|
{ label => 'active-con', nlabel => 'datasource.connections.active.count', set => {
|
||||||
key_values => [ { name => 'ActiveCount' }, { name => 'display' } ],
|
key_values => [ { name => 'ActiveCount' } ],
|
||||||
output_template => 'current active connections: %s',
|
output_template => 'current active connections: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'active_con', template => '%s', min => 0,
|
{ label => 'active_con', template => '%s', min => 0, label_extra_instance => 1 }
|
||||||
label_extra_instance => 1, instance_use => 'display' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'available-con', nlabel => 'datasource.connections.available.count', set => {
|
{ label => 'available-con', nlabel => 'datasource.connections.available.count', set => {
|
||||||
key_values => [ { name => 'AvailableCount' }, { name => 'display' } ],
|
key_values => [ { name => 'AvailableCount' } ],
|
||||||
output_template => 'current available connections: %s',
|
output_template => 'current available connections: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'available_con', template => '%s', min => 0,
|
{ label => 'available_con', template => '%s', min => 0, label_extra_instance => 1 }
|
||||||
label_extra_instance => 1, instance_use => 'display' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'in-use-con', nlabel => 'datasource.connections.inuse.count', set => {
|
{ label => 'in-use-con', nlabel => 'datasource.connections.inuse.count', set => {
|
||||||
key_values => [ { name => 'InUseCount' }, { name => 'display' } ],
|
key_values => [ { name => 'InUseCount' } ],
|
||||||
output_template => 'Current In Use Connections : %s',
|
output_template => 'current in use connections: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'in_use_con', template => '%s', min => 0,
|
{ label => 'in_use_con', template => '%s', min => 0, label_extra_instance => 1 }
|
||||||
label_extra_instance => 1, instance_use => 'display' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ label => 'created-con', nlabel => 'datasource.connections.created.count', set => {
|
{ label => 'created-con', nlabel => 'datasource.connections.created.count', set => {
|
||||||
key_values => [ { name => 'CreatedCount', diff => 1 }, { name => 'display' } ],
|
key_values => [ { name => 'CreatedCount', diff => 1 } ],
|
||||||
output_template => 'created connections: %s',
|
output_template => 'created connections: %s',
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => 'created_con', template => '%s', min => 0,
|
{ label => 'created_con', template => '%s', min => 0, label_extra_instance => 1 }
|
||||||
label_extra_instance => 1, instance_use => 'display' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +115,7 @@ sub manage_selection {
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{datasource}->{$ds_name} = {
|
$self->{datasource}->{$ds_name} = {
|
||||||
|
display => $ds_name,
|
||||||
AvailableCount => defined($result->{$key}->{AvailableConnectionCount}) ? $result->{$key}->{AvailableConnectionCount} : $result->{$key}->{AvailableCount},
|
AvailableCount => defined($result->{$key}->{AvailableConnectionCount}) ? $result->{$key}->{AvailableConnectionCount} : $result->{$key}->{AvailableCount},
|
||||||
ActiveCount => defined($result->{$key}->{ConnectionCount}) ? $result->{$key}->{ConnectionCount} : $result->{$key}->{ActiveCount},
|
ActiveCount => defined($result->{$key}->{ConnectionCount}) ? $result->{$key}->{ConnectionCount} : $result->{$key}->{ActiveCount},
|
||||||
CreatedCount => defined($result->{$key}->{ConnectionCreatedCount}) ? $result->{$key}->{ConnectionCreatedCount} : $result->{$key}->{CreatedCount},
|
CreatedCount => defined($result->{$key}->{ConnectionCreatedCount}) ? $result->{$key}->{ConnectionCreatedCount} : $result->{$key}->{CreatedCount},
|
||||||
|
|
Loading…
Reference in New Issue