void add(Cache<?, ?> cache, Ticker ticker) {
            lock.lock();
            try {
                for (CacheReference ref : cacheRefs) {
                    if (ref.get() == cache) {
                        // Do not aggregate more than once for the same instance.
                        return;
                    }
                }

                cacheRefs.add(new CacheReference(cache, ticker));
            } finally {
                lock.unlock();
            }

            if (cache instanceof LoadingCache && hasLoadingCache.compareAndSet(false, true)) {
                // Add the following meters only for LoadingCache and only once.
                final String loads = idPrefix.name("loads");

                parent.more().counter(loads, idPrefix.tags("result", "success"), this,
                                      func(LOAD_SUCCESS_COUNT, ref -> ref.cacheStats.loadSuccessCount()));
                parent.more().counter(loads, idPrefix.tags("result", "failure"), this,
                                      func(LOAD_FAILURE_COUNT, ref -> ref.cacheStats.loadFailureCount()));
                parent.more().counter(idPrefix.name("load.duration"), idPrefix.tags(), this,
                                      func(TOTAL_LOAD_TIME, ref -> ref.cacheStats.totalLoadTime()));
            }
        }
An array whose each element is the sum of the garbage-collected {@link Cache} stats.
{@link Type#ordinal()} signifies the index of this array.
core/src/main/java/com/linecorp/armeria/internal/common/metric/CaffeineMetricSupport.java