I have a piece of an old code which uses Codahale metrics. I would like to change it to Micrometer. And I am fine with switching the easy ones, I have some troubles to reproduce funtionality of some Codahale specific objets.
And I am fine with switching the easy ones, I have some troubles to reproduce funtionality of some Codahale specific objets. I did not find any satisfying comparison in the area. I was basing on documentation and articles, but still no luck. I don't know if what I want to do is even possible.
For example, how would this look in Micrometer?
final CachedGauge<T> g = new CachedGauge<T>(refreshPeriod, TimeUnit.SECONDS) {
@Override
protected T loadValue() {
try {
return provider.call();
} catch (Exception ex) {
throw new RuntimeException("Failed to get cached value for [" + name + "]", ex);
}
}
};
metricRegistry.register("gauge." + fullName, g);
or just a simple String Gauge?:
Gauge<String> gauge;
or a ratio gauge?
RatioGauge ratioGauge = new AttendanceRatioGauge(15, 20);
when I want to compare two long values for example?