Module lettuce.core

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 of SocketAddresses) and command type.
Since:
6.0
Author:
Mark Paluch
  • Method Details

    • disabled

      static CommandLatencyRecorder disabled()
      Returns a disabled no-op CommandLatencyRecorder.
      Returns:
      a disabled CommandLatencyRecorder.
    • recordCommandLatency

      void recordCommandLatency​(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
      Record the command latency per connectionPoint and commandType.
      Parameters:
      local - the local address
      remote - the remote address
      commandType - the command type
      firstResponseLatency - latency value in TimeUnit.NANOSECONDS from send to the first response
      completionLatency - latency value in TimeUnit.NANOSECONDS from send to the command completion
    • isEnabled

      default boolean isEnabled()
      Returns true if the metric collector is enabled.
      Returns:
      true if the metric collector is enabled