use of org.bf2.srs.fleetmanager.rest.publicapi.beans.Registry in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class MetricsRecorder method record.
public void record(Runnable action, String subId, Iterable<Tag> additionalTags) {
try {
Timer.builder(id + subId + ".time").tags(tags).tags(additionalTags).publishPercentiles(0.3, 0.5, 0.95).publishPercentileHistogram().register(registry).record(action);
Counter.builder(id + subId + ".count").tags(tags).tags(additionalTags).register(registry).increment();
} catch (Exception e) {
Counter.builder(id + subId + ".count.failure").tags(tags).tags(additionalTags).tag("exception", e.getClass().getName()).register(registry).increment();
throw new RuntimeException("Failure recording method execution (id: " + id + subId + ")", e);
}
}
Aggregations