Package glide.api.commands
Interface ServerManagementCommands
-
- All Known Implementing Classes:
GlideClient
public interface ServerManagementCommandsSupports commands for the "Server Management" group for a standalone client.- See Also:
- Server Management Commands
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVERSION_VALKEY_APIA keyword forlolwut(int)andlolwut(int, int[]).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.String[]>aclCat()Returns a list of all ACL categories, or a list of commands within a category.java.util.concurrent.CompletableFuture<java.lang.String[]>aclCat(java.lang.String category)Returns a list of commands within the specified ACL category.java.util.concurrent.CompletableFuture<java.lang.Long>aclDelUser(java.lang.String[] usernames)Deletes all specified ACL users and terminates their connections.java.util.concurrent.CompletableFuture<java.lang.String>aclDryRun(java.lang.String username, java.lang.String command, java.lang.String[] args)Simulates the execution of a command by a user without actually executing the command.java.util.concurrent.CompletableFuture<java.lang.String>aclGenPass()Generates a random password for ACL users.java.util.concurrent.CompletableFuture<java.lang.String>aclGenPass(int bits)Generates a random password with the specified number of bits for ACL users.java.util.concurrent.CompletableFuture<java.lang.Object>aclGetUser(java.lang.String username)Returns all ACL rules for the specified user.java.util.concurrent.CompletableFuture<java.lang.String[]>aclList()Returns a list of all ACL users and their rules in ACL configuration file format.java.util.concurrent.CompletableFuture<java.lang.String>aclLoad()Reloads ACL rules from the configured ACL configuration file.java.util.concurrent.CompletableFuture<java.lang.Object[]>aclLog()Returns the ACL security events log.java.util.concurrent.CompletableFuture<java.lang.Object[]>aclLog(int count)Returns the specified number of ACL security events from the log.java.util.concurrent.CompletableFuture<java.lang.String>aclSave()Saves the current ACL rules to the configured ACL configuration file.java.util.concurrent.CompletableFuture<java.lang.String>aclSetUser(java.lang.String username, java.lang.String[] rules)Creates or modifies an ACL user and its rules.java.util.concurrent.CompletableFuture<java.lang.String[]>aclUsers()Returns a list of all ACL usernames.java.util.concurrent.CompletableFuture<java.lang.String>aclWhoami()Returns the username of the current connection.java.util.concurrent.CompletableFuture<java.lang.String>bgrewriteaof()Initiates a background rewrite of the append-only file (AOF).java.util.concurrent.CompletableFuture<java.lang.String>bgsave()Asynchronously saves the dataset to disk in the background.java.util.concurrent.CompletableFuture<java.lang.String>bgsaveCancel()Aborts all in-progress and scheduled background saves.java.util.concurrent.CompletableFuture<java.lang.String>bgsaveSchedule()Schedules a background save of the database.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>>configGet(java.lang.String[] parameters)Get the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.java.util.concurrent.CompletableFuture<java.lang.String>configResetStat()Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.java.util.concurrent.CompletableFuture<java.lang.String>configRewrite()Rewrites the configuration file with the current configuration.java.util.concurrent.CompletableFuture<java.lang.String>configSet(java.util.Map<java.lang.String,java.lang.String> parameters)Sets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.java.util.concurrent.CompletableFuture<java.lang.Long>dbsize()Returns the number of keys in the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>failover()Starts a coordinated failover from the currently-connected-to primary to one of its replicas.java.util.concurrent.CompletableFuture<java.lang.String>failover(FailoverOptions options)Starts a coordinated failover from the currently-connected-to primary to one of its replicas.java.util.concurrent.CompletableFuture<java.lang.String>flushall()Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushall(FlushMode mode)Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushdb()Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>flushdb(FlushMode mode)Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>info()Gets information and statistics about the server using theInfoOptions.Section.DEFAULToption.java.util.concurrent.CompletableFuture<java.lang.String>info(InfoOptions.Section[] sections)Get information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.java.util.concurrent.CompletableFuture<java.lang.Long>lastsave()ReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.java.util.concurrent.CompletableFuture<java.lang.Object[][]>latencyHistory(@NonNull java.lang.String event)Returns the latency spike time series for the specified event.java.util.concurrent.CompletableFuture<java.lang.Object[][]>latencyLatest()Reports the latest latency events logged by the server.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset()Resets the latency spike time series for all events.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset(@NonNull java.lang.String[] events)Resets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.java.util.concurrent.CompletableFuture<java.lang.String>lolwut()Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int version)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int[] parameters)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int version, int[] parameters)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<java.lang.String>memoryDoctor()Returns a report about memory problems detected by the server.java.util.concurrent.CompletableFuture<java.lang.String>memoryMallocStats()Returns the internal statistics of the memory allocator.java.util.concurrent.CompletableFuture<java.lang.String>memoryPurge()Asks the server to reclaim memory from the allocator back to the operating system.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>>memoryStats()Returns detailed memory consumption statistics of the server.java.util.concurrent.CompletableFuture<java.lang.String>replicaof(@NonNull java.lang.String host, int port)Makes the server a replica of the specified primary.java.util.concurrent.CompletableFuture<java.lang.String>replicaofNoOne()Promotes the current server to a primary by stopping replication.java.util.concurrent.CompletableFuture<java.lang.String>save()Synchronously saves the dataset to disk.java.util.concurrent.CompletableFuture<java.lang.String[]>time()Returns the server time.
-
-
-
Field Detail
-
VERSION_VALKEY_API
static final java.lang.String VERSION_VALKEY_API
A keyword forlolwut(int)andlolwut(int, int[]).- See Also:
- Constant Field Values
-
-
Method Detail
-
info
java.util.concurrent.CompletableFuture<java.lang.String> info()
Gets information and statistics about the server using theInfoOptions.Section.DEFAULToption.- Returns:
- A
Stringwith the information for the default sections. - See Also:
- valkey.io for details.
- Example:
String response = client.info().get(); assert response.contains("# Stats");
-
info
java.util.concurrent.CompletableFuture<java.lang.String> info(InfoOptions.Section[] sections)
Get information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.- Parameters:
sections- A list ofInfoOptions.Sectionvalues specifying which sections of information to retrieve. When no parameter is provided, theInfoOptions.Section.DEFAULToption is assumed.- Returns:
- A
Stringcontaining the information for the sections requested. - See Also:
- valkey.io for details.
- Example:
String response = regularClient.info(new Section[] { Section.STATS }).get(); assert response.contains("total_net_input_bytes");
-
configRewrite
java.util.concurrent.CompletableFuture<java.lang.String> configRewrite()
Rewrites the configuration file with the current configuration.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.configRewrite().get(); assert response.equals("OK");
-
configResetStat
java.util.concurrent.CompletableFuture<java.lang.String> configResetStat()
Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.configResetStat().get(); assert response.equals("OK");
-
configGet
java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> configGet(java.lang.String[] parameters)
Get the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.- Parameters:
parameters- Anarrayof configuration parameter names to retrieve values for.- Returns:
- A
mapof values corresponding to the configuration parameters. - See Also:
- valkey.io for details.
- Example:
Map<String, String> configParams = client.configGet(new String[] {"timeout" , "maxmemory"}).get(); assert configParams.get("timeout").equals("1000"); assert configParams.get("maxmemory").equals("1GB");
-
configSet
java.util.concurrent.CompletableFuture<java.lang.String> configSet(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.- Parameters:
parameters- Amapconsisting of configuration parameters and their respective values to set.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.configSet(Map.of("timeout", "1000", "maxmemory", "1GB")).get(); assert response.equals("OK");
-
time
java.util.concurrent.CompletableFuture<java.lang.String[]> time()
Returns the server time.- Returns:
- The current server time as a
Stringarray with two elements: AUNIX TIMEand the amount of microseconds already elapsed in the current second. The returned array is in a[UNIX TIME, Microseconds already elapsed]format. - See Also:
- valkey.io for details.
- Example:
String[] serverTime = client.time().get(); System.out.println("Server time is: " + serverTime[0] + "." + serverTime[1]);
-
lastsave
java.util.concurrent.CompletableFuture<java.lang.Long> lastsave()
ReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.- Returns:
UNIX TIMEof the last DB save executed with success.- See Also:
- valkey.io for details.
- Example:
Long timestamp = client.lastsave().get(); System.out.printf("Last DB save was done at %s%n", Instant.ofEpochSecond(timestamp));
-
save
java.util.concurrent.CompletableFuture<java.lang.String> save()
Synchronously saves the dataset to disk.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.save().get(); assert response.equals("OK");
-
bgsave
java.util.concurrent.CompletableFuture<java.lang.String> bgsave()
Asynchronously saves the dataset to disk in the background.- Returns:
- A non-empty status string.
- See Also:
- valkey.io for details.
- Example:
String response = client.bgsave().get(); assert response.contains("Background saving");
-
bgsaveSchedule
java.util.concurrent.CompletableFuture<java.lang.String> bgsaveSchedule()
Schedules a background save of the database.- Returns:
- A non-empty status string.
- See Also:
- valkey.io for details.
- Example:
String response = client.bgsaveSchedule().get(); assert response.contains("Background saving");
-
bgsaveCancel
java.util.concurrent.CompletableFuture<java.lang.String> bgsaveCancel()
Aborts all in-progress and scheduled background saves.- Returns:
- A non-empty status string.
- Since:
- Valkey 8.1
- See Also:
- valkey.io for details.
- Example:
String response = client.bgsaveCancel().get(); assert response.contains("Background saving");
-
bgrewriteaof
java.util.concurrent.CompletableFuture<java.lang.String> bgrewriteaof()
Initiates a background rewrite of the append-only file (AOF).- Returns:
- A non-empty status string.
- See Also:
- valkey.io for details.
- Example:
String response = client.bgrewriteaof().get(); assert response.contains("Background append only file rewriting");
-
flushall
java.util.concurrent.CompletableFuture<java.lang.String> flushall()
Deletes all the keys of all the existing databases. This command never fails.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.flushall().get(); assert response.equals("OK");
-
flushall
java.util.concurrent.CompletableFuture<java.lang.String> flushall(FlushMode mode)
Deletes all the keys of all the existing databases. This command never fails.- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.flushall(ASYNC).get(); assert response.equals("OK");
-
flushdb
java.util.concurrent.CompletableFuture<java.lang.String> flushdb()
Deletes all the keys of the currently selected database. This command never fails.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.flushdb().get(); assert response.equals("OK");
-
flushdb
java.util.concurrent.CompletableFuture<java.lang.String> flushdb(FlushMode mode)
Deletes all the keys of the currently selected database. This command never fails.- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.flushdb(ASYNC).get(); assert response.equals("OK");
-
lolwut
java.util.concurrent.CompletableFuture<java.lang.String> lolwut()
Displays a piece of generative computer art and the Valkey version.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
- Example:
String data = client.lolwut().get(); System.out.println(data); assert data.contains("Redis ver. 7.2.3");
-
lolwut
java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int[] parameters)
Displays a piece of generative computer art and the Valkey version.- Parameters:
parameters- Additional set of arguments in order to change the output:- On Valkey version
5, those are length of the line, number of squares per row, and number of squares per column. - On Valkey version
6, those are number of columns and number of lines. - On other versions parameters are ignored.
- On Valkey version
- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
- Example:
String data = client.lolwut(new int[] { 40, 20 }).get(); System.out.println(data); assert data.contains("Redis ver. 7.2.3");
-
lolwut
java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int version)
Displays a piece of generative computer art and the Valkey version.- Parameters:
version- Version of computer art to generate.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
- Example:
String data = client.lolwut(6).get(); System.out.println(data); assert data.contains("Redis ver. 7.2.3");
-
lolwut
java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int version, int[] parameters)Displays a piece of generative computer art and the Valkey version.- Parameters:
version- Version of computer art to generate.parameters- Additional set of arguments in order to change the output:- For version
5, those are length of the line, number of squares per row, and number of squares per column. - For version
6, those are number of columns and number of lines.
- For version
- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
- Example:
String data = client.lolwut(6, new int[] { 40, 20 }).get(); System.out.println(data); assert data.contains("Redis ver. 7.2.3"); data = client.lolwut(5, new int[] { 30, 5, 5 }).get(); System.out.println(data); assert data.contains("Redis ver. 7.2.3");
-
dbsize
java.util.concurrent.CompletableFuture<java.lang.Long> dbsize()
Returns the number of keys in the currently selected database.- Returns:
- The number of keys in the currently selected database.
- See Also:
- valkey.io for details.
- Example:
Long numKeys = client.dbsize().get(); System.out.printf("Number of keys in the current database: %d%n", numKeys);
-
aclCat
java.util.concurrent.CompletableFuture<java.lang.String[]> aclCat()
Returns a list of all ACL categories, or a list of commands within a category.- Returns:
- An array of ACL categories or commands.
- See Also:
- valkey.io for details.
- Example:
String[] categories = client.aclCat().get(); assert Arrays.asList(categories).contains("string");
-
aclCat
java.util.concurrent.CompletableFuture<java.lang.String[]> aclCat(java.lang.String category)
Returns a list of commands within the specified ACL category.- Parameters:
category- The ACL category to list commands for.- Returns:
- An array of commands within the specified category.
- See Also:
- valkey.io for details.
- Example:
String[] commands = client.aclCat("string").get(); assert Arrays.asList(commands).contains("get");
-
aclDelUser
java.util.concurrent.CompletableFuture<java.lang.Long> aclDelUser(java.lang.String[] usernames)
Deletes all specified ACL users and terminates their connections.- Parameters:
usernames- An array of usernames to delete.- Returns:
- The number of users deleted.
- See Also:
- valkey.io for details.
- Example:
Long deletedCount = client.aclDelUser(new String[] {"user1", "user2"}).get(); assert deletedCount == 2L;
-
aclDryRun
java.util.concurrent.CompletableFuture<java.lang.String> aclDryRun(java.lang.String username, java.lang.String command, java.lang.String[] args)Simulates the execution of a command by a user without actually executing the command.- Parameters:
username- The username to simulate command execution for.command- The command to simulate.args- The command arguments.- Returns:
"OK"if the user can execute the command, otherwise an error is returned.- See Also:
- valkey.io for details.
- Example:
String result = client.aclDryRun("user1", "get", new String[] {"key"}).get(); assert result.equals("OK");
-
aclGenPass
java.util.concurrent.CompletableFuture<java.lang.String> aclGenPass()
Generates a random password for ACL users.- Returns:
- A randomly generated password string.
- See Also:
- valkey.io for details.
- Example:
String password = client.aclGenPass().get(); assert password.length() == 64; // Default length
-
aclGenPass
java.util.concurrent.CompletableFuture<java.lang.String> aclGenPass(int bits)
Generates a random password with the specified number of bits for ACL users.- Parameters:
bits- The number of bits for the password (must be a multiple of 4, between 1 and 4096).- Returns:
- A randomly generated password string.
- See Also:
- valkey.io for details.
- Example:
String password = client.aclGenPass(128).get(); assert password.length() == 32; // 128 bits = 32 hex characters
-
aclGetUser
java.util.concurrent.CompletableFuture<java.lang.Object> aclGetUser(java.lang.String username)
Returns all ACL rules for the specified user.- Parameters:
username- The username to get ACL rules for.- Returns:
- An array describing the ACL rules for the user, or
nullif user doesn't exist. - See Also:
- valkey.io for details.
- Example:
Object userInfo = client.aclGetUser("default").get(); assert userInfo != null;
-
aclList
java.util.concurrent.CompletableFuture<java.lang.String[]> aclList()
Returns a list of all ACL users and their rules in ACL configuration file format.- Returns:
- An array of ACL rules for all users.
- See Also:
- valkey.io for details.
- Example:
String[] aclList = client.aclList().get(); assert aclList.length > 0;
-
aclLoad
java.util.concurrent.CompletableFuture<java.lang.String> aclLoad()
Reloads ACL rules from the configured ACL configuration file.- Returns:
"OK"on success.- See Also:
- valkey.io for details.
- Example:
String result = client.aclLoad().get(); assert result.equals("OK");
-
aclLog
java.util.concurrent.CompletableFuture<java.lang.Object[]> aclLog()
Returns the ACL security events log.- Returns:
- An array of ACL security events.
- See Also:
- valkey.io for details.
- Example:
Object[] log = client.aclLog().get(); System.out.printf("ACL log has %d entries%n", log.length);
-
aclLog
java.util.concurrent.CompletableFuture<java.lang.Object[]> aclLog(int count)
Returns the specified number of ACL security events from the log.- Parameters:
count- The number of entries to return.- Returns:
- An array of ACL security events.
- See Also:
- valkey.io for details.
- Example:
Object[] log = client.aclLog(10).get(); assert log.length <= 10;
-
aclSave
java.util.concurrent.CompletableFuture<java.lang.String> aclSave()
Saves the current ACL rules to the configured ACL configuration file.- Returns:
"OK"on success.- See Also:
- valkey.io for details.
- Example:
String result = client.aclSave().get(); assert result.equals("OK");
-
aclSetUser
java.util.concurrent.CompletableFuture<java.lang.String> aclSetUser(java.lang.String username, java.lang.String[] rules)Creates or modifies an ACL user and its rules.- Parameters:
username- The username for the ACL user.rules- An array of ACL rules to apply to the user.- Returns:
"OK"on success.- See Also:
- valkey.io for details.
- Example:
String result = client.aclSetUser("user1", new String[] {"on", "+get", "~*"}).get(); assert result.equals("OK");
-
aclUsers
java.util.concurrent.CompletableFuture<java.lang.String[]> aclUsers()
Returns a list of all ACL usernames.- Returns:
- An array of ACL usernames.
- See Also:
- valkey.io for details.
- Example:
String[] users = client.aclUsers().get(); assert Arrays.asList(users).contains("default");
-
aclWhoami
java.util.concurrent.CompletableFuture<java.lang.String> aclWhoami()
Returns the username of the current connection.- Returns:
- The username of the current connection.
- See Also:
- valkey.io for details.
- Example:
String username = client.aclWhoami().get(); assert username.equals("default");
-
failover
java.util.concurrent.CompletableFuture<java.lang.String> failover()
Starts a coordinated failover from the currently-connected-to primary to one of its replicas. This command must be sent to a primary node. This is the standalone equivalent ofClusterOperationsCommands.clusterFailover().- Returns:
OKif the failover was successfully initiated.- See Also:
- valkey.io for details.
- Example:
String result = client.failover().get(); assert result.equals("OK");
-
failover
java.util.concurrent.CompletableFuture<java.lang.String> failover(FailoverOptions options)
Starts a coordinated failover from the currently-connected-to primary to one of its replicas. This command must be sent to a primary node. This is the standalone equivalent ofClusterOperationsCommands.clusterFailover().- Parameters:
options- The failover options.- Returns:
OKif the failover was successfully initiated.- See Also:
- valkey.io for details.
- Example:
String result = client.failover(FailoverOptions.to("localhost", 6380, 1000)).get(); assert result.equals("OK");
-
replicaof
java.util.concurrent.CompletableFuture<java.lang.String> replicaof(@NonNull @NonNull java.lang.String host, int port)Makes the server a replica of the specified primary.- Parameters:
host- The host of the primary to replicate.port- The port of the primary to replicate.- Returns:
OKon success.- See Also:
- valkey.io for details.
- Example:
String result = client.replicaof("localhost", 6379).get(); assert result.equals("OK");
-
replicaofNoOne
java.util.concurrent.CompletableFuture<java.lang.String> replicaofNoOne()
Promotes the current server to a primary by stopping replication.- Returns:
OKon success.- See Also:
- valkey.io for details.
- Example:
String result = client.replicaofNoOne().get(); assert result.equals("OK");
-
latencyHistory
java.util.concurrent.CompletableFuture<java.lang.Object[][]> latencyHistory(@NonNull @NonNull java.lang.String event)Returns the latency spike time series for the specified event.- Parameters:
event- The name of the latency event (e.g., "command").- Returns:
- An array of arrays representing latency spike entries, or an empty array if the event doesn't exist.
- See Also:
- valkey.io for details.
- Example:
Object[][] history = client.latencyHistory("command").get(); for (Object[] entry : history) { System.out.println("Time: " + entry[0] + ", Latency: " + entry[1]); }
-
latencyLatest
java.util.concurrent.CompletableFuture<java.lang.Object[][]> latencyLatest()
Reports the latest latency events logged by the server.- Returns:
- An array of arrays representing latency event info.
- See Also:
- valkey.io for details.
- Example:
Object[][] latest = client.latencyLatest().get(); for (Object[] info : latest) { System.out.println("Event: " + info[0] + ", Latest duration: " + info[2]); }
-
latencyReset
java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset()
Resets the latency spike time series for all events.- Returns:
- The number of event time series that were reset.
- See Also:
- valkey.io for details.
- Example:
Long count = client.latencyReset().get(); System.out.println("Reset " + count + " events");
-
latencyReset
java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset(@NonNull @NonNull java.lang.String[] events)Resets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.- Parameters:
events- The event names to reset.- Returns:
- The number of event time series that were reset.
- See Also:
- valkey.io for details.
- Example:
Long count = client.latencyReset(new String[] {"command"}).get(); System.out.println("Reset " + count + " events");
-
memoryDoctor
java.util.concurrent.CompletableFuture<java.lang.String> memoryDoctor()
Returns a report about memory problems detected by the server.- Returns:
- The memory diagnostic report.
- See Also:
- valkey.io for details.
- Example:
String report = client.memoryDoctor().get(); System.out.println("Memory report: " + report);
-
memoryMallocStats
java.util.concurrent.CompletableFuture<java.lang.String> memoryMallocStats()
Returns the internal statistics of the memory allocator.- Returns:
- The memory allocator statistics.
- See Also:
- valkey.io for details.
- Example:
String stats = client.memoryMallocStats().get(); System.out.println("Allocator stats: " + stats);
-
memoryPurge
java.util.concurrent.CompletableFuture<java.lang.String> memoryPurge()
Asks the server to reclaim memory from the allocator back to the operating system.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
- Example:
String response = client.memoryPurge().get(); assert response.equals("OK");
-
memoryStats
java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> memoryStats()
Returns detailed memory consumption statistics of the server.- Returns:
- A
Mapof memory statistics. - See Also:
- valkey.io for details.
- Example:
Map<String, Object> stats = client.memoryStats().get(); System.out.println("Total allocated: " + stats.get("total.allocated"));
-
-