def report_runtime_metrics(self, batch: metrics.Client) -> None: if not isinstance(self.connection_pool, redis.BlockingConnectionPool): return size = self.connection_pool.max_connections in_use = len(self.connection_pool._connections) # type: ignore batch.gauge("pool.size").replace(size) batch.gauge("pool.in_use").replace(in_use)
def report_runtime_metrics(self, batch: metrics.Client) -> None: if not isinstance(self.connection_pool, rediscluster.ClusterBlockingConnectionPool): return size = self.connection_pool.max_connections open_connections = len(self.connection_pool._connections) batch.gauge("pool.size").replace(size) batch.gauge("pool.open_connections").replace(open_connections)
def report_runtime_metrics(self, batch: metrics.Client) -> None: pool = self.engine.pool if not isinstance(pool, QueuePool): return batch.gauge("pool.size").replace(pool.size()) batch.gauge("pool.open_and_available").replace(pool.checkedin()) batch.gauge("pool.in_use").replace(pool.checkedout()) batch.gauge("pool.overflow").replace(max(pool.overflow(), 0))
def report_runtime_metrics(self, batch: metrics.Client) -> None: if not isinstance(self.connection_pool, redis.BlockingConnectionPool): return size = self.connection_pool.max_connections open_connections = len( self.connection_pool._connections) # type: ignore available = self.connection_pool.pool.qsize() in_use = size - available batch.gauge("pool.size").replace(size) batch.gauge("pool.in_use").replace(in_use) batch.gauge("pool.open_and_available").replace(open_connections - in_use)
def report_runtime_metrics(self, batch: metrics.Client) -> None: batch.gauge("pool.size").replace(self.pool.size) batch.gauge("pool.in_use").replace(self.pool.checkedout)
def report_memcache_runtime_metrics(self, batch: metrics.Client) -> None: pool = self.pooled_client.client_pool batch.gauge("pool.in_use").replace(len(pool.used)) batch.gauge("pool.open_and_available").replace(len(pool.free)) batch.gauge("pool.size").replace(pool.max_size)