-
- All Implemented Interfaces:
public final class StatsRegistry<T extends Meter>Facilitates standard Micrometer Meter usage when we need to use them with parameters. For example, there might be common 'processingTime' timer and we want to use it for
action=action1,action=action2, etc.Also it has a feature that context data for the target tag names is automatically retrieved from ExecutionContextManager and attached to data points generated by this registry's meters.
Note: we introduce multiple overloaded getMeter methods here (
getMeter(tag),getMeter(tag1, tag2), etc) instead of providing generic varargs-based processing because stats collection is expected to be performed quite often. Hence, we want to avoid new array construction every time getMeter is called.
-
-
Method Summary
Modifier and Type Method Description final TgetMeter()final TgetMeter(Object tagValue)final TgetMeter(Object tag1Value, Object tag2value)final TgetMeter(Object tag1Value, Object tag2value, Object tag3value)final TgetMeter(Object tag1Value, Object tag2value, Object tag3value, Object tag4value)-
-
Constructor Detail
-
StatsRegistry
StatsRegistry(List<String> tagNames, Set<Tag> staticTags, MeterRegistry registry, ExecutionContextManager executionContextManager, Set<String> contextTagNames, Function2<MeterRegistry, Iterable<Tag>, T> meterCreator)
- Parameters:
tagNames- list of the tag names to use for the target meter.staticTags- tags to be applied to every data point collected by this registry's meterregistry- meter registry to useexecutionContextManager- context values holdercontextTagNames- context tag names, their values are picked from ExecutionContextManager.getFromCurrentContext and are attached to data points produced by this registry's metersmeterCreator- meter's initializer
-
-
-
-