-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add LATENCY LATEST, LATENCY HISTORY and LATENCY RESET commands
- Loading branch information
Showing
7 changed files
with
211 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/redis/clients/jedis/resps/LatencyHistoryInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package redis.clients.jedis.resps; | ||
|
||
import redis.clients.jedis.Builder; | ||
|
||
import java.util.List; | ||
|
||
import static redis.clients.jedis.BuilderFactory.LONG; | ||
|
||
public class LatencyHistoryInfo { | ||
|
||
private final long timestamp; | ||
private final long latency; | ||
|
||
public LatencyHistoryInfo(long timestamp, long latency) { | ||
this.timestamp = timestamp; | ||
this.latency = latency; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public long getLatency() { | ||
return latency; | ||
} | ||
|
||
public static final Builder<LatencyHistoryInfo> LATENCY_HISTORY_BUILDER = new Builder<LatencyHistoryInfo>() { | ||
@Override | ||
public LatencyHistoryInfo build(Object data) { | ||
List<Object> commandData = (List<Object>) data; | ||
|
||
long timestamp = LONG.build(commandData.get(0)); | ||
long latency = LONG.build(commandData.get(1)); | ||
|
||
return new LatencyHistoryInfo(timestamp, latency); | ||
} | ||
}; | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/redis/clients/jedis/resps/LatencyLatestInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package redis.clients.jedis.resps; | ||
|
||
import redis.clients.jedis.Builder; | ||
|
||
import java.util.List; | ||
|
||
import static redis.clients.jedis.BuilderFactory.LONG; | ||
import static redis.clients.jedis.BuilderFactory.STRING; | ||
|
||
public class LatencyLatestInfo { | ||
|
||
private final String command; | ||
private final long timestamp; | ||
private final long lastEventLatency; | ||
private final long maxEventLatency; | ||
|
||
public LatencyLatestInfo(String command, long timestamp, long lastEventLatency, long maxEventLatency) { | ||
this.command = command; | ||
this.timestamp = timestamp; | ||
this.lastEventLatency = lastEventLatency; | ||
this.maxEventLatency = maxEventLatency; | ||
} | ||
|
||
public String getCommand() { | ||
return command; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public long getLastEventLatency() { | ||
return lastEventLatency; | ||
} | ||
|
||
public long getMaxEventLatency() { | ||
return maxEventLatency; | ||
} | ||
|
||
public static final Builder<LatencyLatestInfo> LATENCY_LATEST_BUILDER = new Builder<LatencyLatestInfo>() { | ||
@Override | ||
public LatencyLatestInfo build(Object data) { | ||
List<Object> commandData = (List<Object>) data; | ||
|
||
String command = STRING.build(commandData.get(0)); | ||
long timestamp = LONG.build(commandData.get(1)); | ||
long lastEventLatency = LONG.build(commandData.get(2)); | ||
long maxEventLatency = LONG.build(commandData.get(3)); | ||
|
||
return new LatencyLatestInfo(command, timestamp, lastEventLatency, maxEventLatency); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters