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, wait
create
public DefaultCommandLatencyCollector(CommandLatencyCollectorOptions options)
public void recordCommandLatency(SocketAddress local, SocketAddress remote, ProtocolKeyword commandType, long firstResponseLatency, long completionLatency)
connectionPoint
and commandType
.recordCommandLatency
in interface CommandLatencyCollector
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.public boolean isEnabled()
MetricCollector
true
if the metric collector is enabled.isEnabled
in interface MetricCollector<Map<CommandLatencyId,CommandMetrics>>
true
if the metric collector is enabled.public void shutdown()
MetricCollector
shutdown
in interface MetricCollector<Map<CommandLatencyId,CommandMetrics>>
public Map<CommandLatencyId,CommandMetrics> retrieveMetrics()
MetricCollector
retrieveMetrics
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 CommandLatencyCollector
Copyright © 2020 lettuce.io. All rights reserved.