
io.lettuce.core.protocol.LatencyMeteredCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettuce-core Show documentation
Show all versions of lettuce-core Show documentation
Advanced and thread-safe Java Redis client for synchronous, asynchronous, and
reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs
and much more.
The newest version!
package io.lettuce.core.protocol;
/**
* {@link CommandWrapper} implementation to track {@link WithLatency command latency}.
*
* @author Mark Paluch
* @since 4.4
*/
class LatencyMeteredCommand extends CommandWrapper implements WithLatency {
private long sentNs = -1;
private long firstResponseNs = -1;
private long completedNs = -1;
public LatencyMeteredCommand(RedisCommand command) {
super(command);
}
@Override
public void sent(long timeNs) {
sentNs = timeNs;
firstResponseNs = -1;
completedNs = -1;
}
@Override
public void firstResponse(long timeNs) {
firstResponseNs = timeNs;
}
@Override
public void completed(long timeNs) {
completedNs = timeNs;
}
@Override
public long getSent() {
return sentNs;
}
@Override
public long getFirstResponse() {
return firstResponseNs;
}
@Override
public long getCompleted() {
return completedNs;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy