Replace connection_pool with vmpooler generic_connection_pool. Fix tests for changes.

This commit is contained in:
kirby@puppetlabs.com 2020-04-29 20:38:09 -07:00
parent b32b88b753
commit 90e09bfe1c
13 changed files with 808 additions and 509 deletions

View file

@ -160,9 +160,16 @@ module Vmpooler
pools
end
def self.redis_connection_pool(host, port, password, size, timeout)
ConnectionPool.new(size: size, timeout: timeout) {
redis_connection(host, port, password)
def self.redis_connection_pool(host, port, password, size, timeout, metrics)
Vmpooler::PoolManager::GenericConnectionPool.new(
metrics: metrics,
metric_prefix: 'redis_connection_pool',
size: size,
timeout: timeout
) {
connection = Concurrent::Hash.new
redis = redis_connection(host, port, password)
connection['connection'] = redis
}
end