Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LATENCY DOCTOR command #3239

Merged
merged 1 commit into from
Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/redis/clients/jedis/Jedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -9193,6 +9193,13 @@ public String lolwut(LolwutParams lolwutParams) {
return connection.getBulkReply();
}

@Override
public String latencyDoctor() {
checkIsInMultiOrPipeline();
connection.sendCommand(LATENCY, DOCTOR);
return connection.getBulkReply();
}

@Override
public StreamEntryID xadd(final String key, final StreamEntryID id, final Map<String, String> hash) {
checkIsInMultiOrPipeline();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/redis/clients/jedis/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static enum Command implements ProtocolCommand {
XADD, XLEN, XDEL, XTRIM, XRANGE, XREVRANGE, XREAD, XACK, XGROUP, XREADGROUP, XPENDING, XCLAIM,
XAUTOCLAIM, XINFO, BITFIELD_RO, ROLE, FAILOVER, GEOSEARCH, GEOSEARCHSTORE, EVAL_RO, EVALSHA_RO,
LOLWUT, EXPIRETIME, PEXPIRETIME, FUNCTION, FCALL, FCALL_RO, LMPOP, BLMPOP, ZMPOP, BZMPOP,
COMMAND, @Deprecated STRALGO;
COMMAND, LATENCY, @Deprecated STRALGO;

private final byte[] raw;

Expand Down
16 changes: 16 additions & 0 deletions src/main/java/redis/clients/jedis/commands/ServerCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,20 @@ public interface ServerCommands {
String lolwut();

String lolwut(LolwutParams lolwutParams);

/**
* The LATENCY DOCTOR command reports about different latency-related issues and advises about
* possible remedies.
* <p>
* This command is the most powerful analysis tool in the latency monitoring framework, and is
* able to provide additional statistical data like the average period between latency spikes, the
* median deviation, and a human-readable analysis of the event. For certain events, like fork,
* additional information is provided, like the rate at which the system forks processes.
* <p>
* This is the output you should post in the Redis mailing list if you are looking for help about
* Latency related issues.
*
* @return the report
*/
String latencyDoctor();
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ public void lolwut() {
assertNotNull(lolwutVersion);
}

@Test
public void latencyDoctor() {
String report = jedis.latencyDoctor();
assertNotNull(report);
}

@Test
public void exists() {
String status = jedis.set("foo", "bar");
Expand Down