void cleanupInactiveMeters() {
        final List<Meters> unusedMetersList = new ArrayList<>();
        try {
            lock.lock();
            // Prevent meter registration while cleaning up.
            garbageCollecting = true;

            // Collect unused meters.
            try {
                for (final Iterator<Entry<List<Tag>, Meters>> it = metersMap.entrySet().iterator();
                     it.hasNext();) {
                    final Entry<List<Tag>, Meters> entry = it.next();
                    final Meters meters = entry.getValue();
                    if (meters.activeConnections() == 0) {
                        unusedMetersList.add(meters);
                        it.remove();
                    }
                }

                if (unusedMetersList.isEmpty()) {
                    garbageCollecting = false;
                    return;
                }
            } finally {
                lock.unlock();
            }

            // Remove unused meters.
            for (Meters meters : unusedMetersList) {
                meters.remove(meterRegistry);
            }

            // Register metrics for the pending meters.
            lock.lock();
            try {
                metersMap.values().forEach(Meters::maybeRegisterMetrics);
                garbageCollecting = false;
            } finally {
                lock.unlock();
            }
        } catch (Throwable e) {
            logger.warn("Failed to cleanup inactive meters.", e);
            garbageCollecting = false;
        }

        if (closed) {
            return;
        }

        // Schedule the next cleanup task.
        scheduledFuture = CLEANUP_EXECUTOR.schedule(this::cleanupInactiveMeters,
                                                    nextCleanupDelaySeconds(), TimeUnit.SECONDS);
    }
Creates a new instance with the specified {@link Meter} name.
core/src/main/java/com/linecorp/armeria/client/ConnectionPoolMetrics.java