@ -57,6 +57,7 @@ import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_IN_
import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_NOT_IN_USE ;
import static com.zaxxer.hikari.util.UtilityElf.createThreadPoolExecutor ;
import static com.zaxxer.hikari.util.UtilityElf.quietlySleep ;
import static com.zaxxer.hikari.util.UtilityElf.safeIsAssignableFrom ;
import static java.util.Collections.unmodifiableCollection ;
import static java.util.concurrent.TimeUnit.MILLISECONDS ;
import static java.util.concurrent.TimeUnit.SECONDS ;
@ -272,10 +273,10 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag
* /
public void setMetricRegistry ( Object metricRegistry )
{
if ( metricRegistry ! = null & & metricRegistry. getClass ( ) . getName ( ) . contains ( " MetricRegistry") ) {
if ( metricRegistry ! = null & & safeIsAssignableFrom( metricRegistry , "com.codahale.metrics. MetricRegistry") ) {
setMetricsTrackerFactory ( new CodahaleMetricsTrackerFactory ( ( MetricRegistry ) metricRegistry ) ) ;
}
else if ( metricRegistry ! = null & & metricRegistry. getClass ( ) . getName ( ) . contains ( " MeterRegistry") ) {
else if ( metricRegistry ! = null & & safeIsAssignableFrom( metricRegistry , "io.micrometer.core.instrument. MeterRegistry") ) {
setMetricsTrackerFactory ( new MicrometerMetricsTrackerFactory ( ( MeterRegistry ) metricRegistry ) ) ;
}
else {