Class MicrometerHolder
java.lang.Object
org.springframework.kafka.support.micrometer.MicrometerHolder
A wrapper for micrometer timers when available on the class path.
- Since:
- 2.5
- Author:
- Gary Russell
-
Constructor Summary
ConstructorDescriptionMicrometerHolder
(ApplicationContext context, String name, String timerName, String timerDesc, Function<Object, Map<String, String>> tagsProvider) Create an instance with the provided properties.MicrometerHolder
(ApplicationContext context, String name, String timerName, String timerDesc, Map<String, String> tags) Deprecated. -
Method Summary
-
Constructor Details
-
MicrometerHolder
@Deprecated public MicrometerHolder(@Nullable ApplicationContext context, String name, String timerName, String timerDesc, Map<String, String> tags) Deprecated.Create an instance with the provided properties.- Parameters:
context
- the application context from which to obtain the meter registry.name
- the value of the 'name' tag.timerName
- the timer name.timerDesc
- the timer description.tags
- additional tags.
-
MicrometerHolder
public MicrometerHolder(@Nullable ApplicationContext context, String name, String timerName, String timerDesc, Function<Object, Map<String, String>> tagsProvider) Create an instance with the provided properties.- Parameters:
context
- the application context from which to obtain the meter registry.name
- the value of the 'name' tag.timerName
- the timer name.timerDesc
- the timer description.tagsProvider
- the tags provider.- Since:
- 2.9.7
-
-
Method Details
-
start
Start the timer.- Returns:
- the sample.
-
success
Record success.- Parameters:
sample
- the sample.- See Also:
-
failure
Record failure.- Parameters:
sample
- the sample.exception
- the exception name.- See Also:
-
success
Record success.- Parameters:
sample
- the sample.record
- the consumer record.- See Also:
-
failure
Record failure.- Parameters:
sample
- the sample.exception
- the exception name.record
- the consumer record.- See Also:
-
destroy
public void destroy()Remove the timers.
-
MicrometerHolder(ApplicationContext, String, String, String, Function)
.