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 CommandLatencyCollectorlocal - 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.public boolean isEnabled()
MetricCollectortrue if the metric collector is enabled.isEnabled in interface MetricCollector<Map<CommandLatencyId,CommandMetrics>>true if the metric collector is enabled.public 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 CommandLatencyCollectorCopyright © 2020 lettuce.io. All rights reserved.