Package io.lettuce.core.metrics
Class MicrometerCommandLatencyRecorder
- java.lang.Object
-
- io.lettuce.core.metrics.MicrometerCommandLatencyRecorder
-
- All Implemented Interfaces:
CommandLatencyRecorder
public class MicrometerCommandLatencyRecorder extends Object implements CommandLatencyRecorder
Micrometer implementation ofCommandLatencyRecorder
- Since:
- 6.1
- Author:
- Steven Sheehy
-
-
Constructor Summary
Constructors Constructor Description MicrometerCommandLatencyRecorder(io.micrometer.core.instrument.MeterRegistry meterRegistry, MicrometerOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.micrometer.core.instrument.Timer
completionTimer(CommandLatencyId commandLatencyId)
protected io.micrometer.core.instrument.Timer
firstResponseTimer(CommandLatencyId commandLatencyId)
boolean
isEnabled()
Returnstrue
if the metric collector is enabled.void
recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
Record the command latency perconnectionPoint
andcommandType
.void
recordCommandLatency(SocketAddress local, SocketAddress remote, RedisCommand<?,?,?> redisCommand, long firstResponseLatency, long completionLatency)
Record the command latency perconnectionPoint
andcommandType
.
-
-
-
Constructor Detail
-
MicrometerCommandLatencyRecorder
public MicrometerCommandLatencyRecorder(io.micrometer.core.instrument.MeterRegistry meterRegistry, MicrometerOptions options)
- Parameters:
meterRegistry
-options
-
-
-
Method Detail
-
recordCommandLatency
public void recordCommandLatency(SocketAddress local, SocketAddress remote, RedisCommand<?,?,?> redisCommand, long firstResponseLatency, long completionLatency)
Description copied from interface:CommandLatencyRecorder
Record the command latency perconnectionPoint
andcommandType
.- Specified by:
recordCommandLatency
in interfaceCommandLatencyRecorder
- Parameters:
local
- the local addressremote
- the remote addressredisCommand
- the commandfirstResponseLatency
- latency value inTimeUnit.NANOSECONDS
from send to the first responsecompletionLatency
- latency value inTimeUnit.NANOSECONDS
from send to the command completion
-
recordCommandLatency
public void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
Description copied from interface:CommandLatencyRecorder
Record the command latency perconnectionPoint
andcommandType
.- Specified by:
recordCommandLatency
in interfaceCommandLatencyRecorder
- Parameters:
local
- the local addressremote
- the remote addresscommandType
- the command typefirstResponseLatency
- latency value inTimeUnit.NANOSECONDS
from send to the first responsecompletionLatency
- latency value inTimeUnit.NANOSECONDS
from send to the command completion
-
isEnabled
public boolean isEnabled()
Description copied from interface:CommandLatencyRecorder
Returnstrue
if the metric collector is enabled.- Specified by:
isEnabled
in interfaceCommandLatencyRecorder
- Returns:
true
if the metric collector is enabled
-
completionTimer
protected io.micrometer.core.instrument.Timer completionTimer(CommandLatencyId commandLatencyId)
-
firstResponseTimer
protected io.micrometer.core.instrument.Timer firstResponseTimer(CommandLatencyId commandLatencyId)
-
-