
com.librato.metrics.reporter.NameCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-librato Show documentation
Show all versions of metrics-librato Show documentation
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