java.lang.Object
io.lettuce.core.metrics.MicrometerCommandLatencyRecorder
- All Implemented Interfaces:
CommandLatencyRecorder
public class MicrometerCommandLatencyRecorder extends Object implements CommandLatencyRecorder
Micrometer implementation of
CommandLatencyRecorder- Since:
- 6.1
- Author:
- Steven Sheehy
-
Constructor Summary
Constructors Constructor Description MicrometerCommandLatencyRecorder(io.micrometer.core.instrument.MeterRegistry meterRegistry, MicrometerOptions options) -
Method Summary
Modifier and Type Method Description protected io.micrometer.core.instrument.TimercompletionTimer(CommandLatencyId commandLatencyId)protected io.micrometer.core.instrument.TimerfirstResponseTimer(CommandLatencyId commandLatencyId)booleanisEnabled()Returnstrueif the metric collector is enabled.voidrecordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword protocolKeyword, long firstResponseLatency, long completionLatency)Record the command latency perconnectionPointandcommandType.
-
Constructor Details
-
MicrometerCommandLatencyRecorder
public MicrometerCommandLatencyRecorder(io.micrometer.core.instrument.MeterRegistry meterRegistry, MicrometerOptions options)- Parameters:
meterRegistry-options-
-
-
Method Details
-
recordCommandLatency
public void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword protocolKeyword, long firstResponseLatency, long completionLatency)Description copied from interface:CommandLatencyRecorderRecord the command latency perconnectionPointandcommandType.- Specified by:
recordCommandLatencyin interfaceCommandLatencyRecorder- Parameters:
local- the local addressremote- the remote addressprotocolKeyword- the command typefirstResponseLatency- latency value inTimeUnit.NANOSECONDSfrom send to the first responsecompletionLatency- latency value inTimeUnit.NANOSECONDSfrom send to the command completion
-
isEnabled
public boolean isEnabled()Description copied from interface:CommandLatencyRecorderReturnstrueif the metric collector is enabled.- Specified by:
isEnabledin interfaceCommandLatencyRecorder- Returns:
trueif the metric collector is enabled
-
completionTimer
-
firstResponseTimer
protected io.micrometer.core.instrument.Timer firstResponseTimer(CommandLatencyId commandLatencyId)
-