All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.librato.metrics.reporter.NameCache Maven / Gradle / Ivy

Go to download

The LibratoReporter class runs in the background, publishing metrics to the Librato Metrics API at the specified interval.

The newest version!
package com.librato.metrics.reporter;

public class NameCache {
    private final LRU cache;

    public NameCache(int maxSize) {
        this.cache = new LRU(maxSize);
    }

    public String get(Signal signal, Supplier fullNameSupplier) {
        String result = cache.get(signal);
        if (result == null) {
            result = fullNameSupplier.get();
            cache.set(signal, result);
        }
        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy