Class MicrometerHolder
- java.lang.Object
-
- org.springframework.kafka.support.micrometer.MicrometerHolder
-
public final class MicrometerHolder extends java.lang.ObjectA wrapper for micrometer timers when available on the class path.- Since:
- 2.5
- Author:
- Gary Russell
-
-
Constructor Summary
Constructors Constructor Description MicrometerHolder(org.springframework.context.ApplicationContext context, java.lang.String name, java.lang.String timerName, java.lang.String timerDesc, java.util.Map<java.lang.String,java.lang.String> tags)Create an instance with the provided properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Remove the timers.voidfailure(java.lang.Object sample, java.lang.String exception)Record failure.java.lang.Objectstart()Start the timer.voidsuccess(java.lang.Object sample)Record success.
-
-
-
Constructor Detail
-
MicrometerHolder
public MicrometerHolder(@Nullable org.springframework.context.ApplicationContext context, java.lang.String name, java.lang.String timerName, java.lang.String timerDesc, java.util.Map<java.lang.String,java.lang.String> tags)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.
-
-
Method Detail
-
start
public java.lang.Object start()
Start the timer.- Returns:
- the sample.
-
success
public void success(java.lang.Object sample)
Record success.- Parameters:
sample- the sample.- See Also:
start()
-
failure
public void failure(java.lang.Object sample, java.lang.String exception)Record failure.- Parameters:
sample- the sample.exception- the exception name.- See Also:
start()
-
destroy
public void destroy()
Remove the timers.
-
-