public class DefaultCommandLatencyCollector extends Object implements CommandLatencyCollector
CommandLatencyCollector for command latencies.| Constructor and Description |
|---|
DefaultCommandLatencyCollector(CommandLatencyCollectorOptions options) |
| Modifier and Type | Method and Description |
|---|---|
static CommandLatencyCollector |
disabled()
Returns a disabled no-op
CommandLatencyCollector. |
static boolean |
isAvailable()
Returns
true if HdrUtils and LatencyUtils are available on the class path. |
boolean |
isEnabled()
Returns
true if the metric collector is enabled. |
void |
recordCommandLatency(SocketAddress local,
SocketAddress remote,
ProtocolKeyword commandType,
long firstResponseLatency,
long completionLatency)
Record the command latency per
connectionPoint and commandType. |
Map<CommandLatencyId,CommandMetrics> |
retrieveMetrics()
Returns the collected/aggregated metrics.
|
void |
shutdown()
Shut down the metrics collector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic DefaultCommandLatencyCollector(CommandLatencyCollectorOptions options)
public void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
connectionPoint and commandType.recordCommandLatency in interface CommandLatencyRecorderlocal - the local addressremote - the remote addresscommandType - the command typefirstResponseLatency - latency value in TimeUnit.NANOSECONDS from send to the first responsecompletionLatency - latency value in TimeUnit.NANOSECONDS from send to the command completionpublic boolean isEnabled()
CommandLatencyRecordertrue if the metric collector is enabled.isEnabled in interface CommandLatencyRecordertrue if the metric collector is enabledpublic void shutdown()
MetricCollectorshutdown in interface MetricCollector<Map<CommandLatencyId,CommandMetrics>>public Map<CommandLatencyId,CommandMetrics> retrieveMetrics()
MetricCollectorretrieveMetrics in interface MetricCollector<Map<CommandLatencyId,CommandMetrics>>public static boolean isAvailable()
true if HdrUtils and LatencyUtils are available on the class path.public static CommandLatencyCollector disabled()
CommandLatencyCollector.disabled in interface CommandLatencyCollectordisabled in interface CommandLatencyRecorderCopyright © 2021 lettuce.io. All rights reserved.