- 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 of
SocketAddresses) and command type.- Since:
- 6.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description static CommandLatencyRecorderdisabled()Returns a disabled no-opCommandLatencyRecorder.default booleanisEnabled()Returnstrueif the metric collector is enabled.voidrecordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)Record the command latency perconnectionPointandcommandType.
-
Method Details
-
disabled
Returns a disabled no-opCommandLatencyRecorder.- Returns:
- a disabled
CommandLatencyRecorder.
-
recordCommandLatency
void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)Record the command latency perconnectionPointandcommandType.- Parameters:
local- the local addressremote- the remote addresscommandType- the command typefirstResponseLatency- latency value inTimeUnit.NANOSECONDSfrom send to the first responsecompletionLatency- latency value inTimeUnit.NANOSECONDSfrom send to the command completion
-
isEnabled
default boolean isEnabled()Returnstrueif the metric collector is enabled.- Returns:
trueif the metric collector is enabled
-