Package io.lettuce.core.metrics
Interface CommandLatencyRecorder
-
- All Known Subinterfaces:
CommandLatencyCollector
- All Known Implementing Classes:
DefaultCommandLatencyCollector
,MicrometerCommandLatencyRecorder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CommandLatencyRecorder
Interface defining a method to collect command latency metrics based upon command completion. Command latencies are collected per connection (identified by local/remote tuples ofSocketAddress
es) andcommand type
.- Since:
- 6.0
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static CommandLatencyRecorder
disabled()
Returns a disabled no-opCommandLatencyRecorder
.default 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
.default void
recordCommandLatency(SocketAddress local, SocketAddress remote, RedisCommand<?,?,?> command, long firstResponseLatency, long completionLatency)
Record the command latency perconnectionPoint
andcommandType
.
-
-
-
Method Detail
-
disabled
static CommandLatencyRecorder disabled()
Returns a disabled no-opCommandLatencyRecorder
.- Returns:
- a disabled
CommandLatencyRecorder
.
-
recordCommandLatency
default void recordCommandLatency(SocketAddress local, SocketAddress remote, RedisCommand<?,?,?> command, long firstResponseLatency, long completionLatency)
Record the command latency perconnectionPoint
andcommandType
.- Parameters:
local
- the local addressremote
- the remote addresscommand
- the commandfirstResponseLatency
- latency value inTimeUnit.NANOSECONDS
from send to the first responsecompletionLatency
- latency value inTimeUnit.NANOSECONDS
from send to the command completion- Since:
- 6.3
-
recordCommandLatency
void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
Record the command latency perconnectionPoint
andcommandType
.- 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
default boolean isEnabled()
Returnstrue
if the metric collector is enabled.- Returns:
true
if the metric collector is enabled
-
-