Interface ModulithEventMetrics
- All Known Implementing Classes:
CrossModuleEventCounterFactory
public interface ModulithEventMetrics
SPI to customize the
Counter
instances created for cross-module application
events.- Since:
- 1.4
- Author:
- Oliver Drotbohm, Marcin Grzejszczak
-
Method Summary
Modifier and TypeMethodDescriptioncustomize
(Class<T> type, BiConsumer<T, io.micrometer.core.instrument.Counter.Builder> consumer) Customizes aCounter.Builder
to eventually produce aCounter
for the event of the given type.Customizes the creation of aCounter.Builder
for events of the given type.
-
Method Details
-
customize
<T> ModulithEventMetrics customize(Class<T> type, BiConsumer<T, io.micrometer.core.instrument.Counter.Builder> consumer) Customizes aCounter.Builder
to eventually produce aCounter
for the event of the given type. TheCounter.Builder
will have been set up named after the fully-qualified type name. To customize the creation, also callcustomize(Class, Function)
.- Type Parameters:
T
- the type of the event.- Parameters:
type
- must not be null.consumer
- must not be null.- Returns:
- will never be null.
- See Also:
-
customize
<T> ModulithEventMetrics customize(Class<T> type, Function<T, io.micrometer.core.instrument.Counter.Builder> factory) Customizes the creation of aCounter.Builder
for events of the given type. The instances created will still be subject to customizations registered viacustomize(Class, BiConsumer)
.- Type Parameters:
T
-- Parameters:
type
- must not be null.factory
- must not be null.- Returns:
- will never be null.
-