Command Concurrency and Tracking Resources
Command Concurrency
Section titled “Command Concurrency”All GLIDE commands make asynchronous calls using CompletableFuture responses.
Tracking resources
Section titled “Tracking resources”GLIDE 1.2 introduces a new NONE Valkey API: getStatistics which returns a HashMap with (currently) 2 properties (available for both GlideClient & GlideClusterClient):
total_connectionscontains the number of active connections across all clientstotal_clientscontains the number of active clients (regardless of its type)
import glide.api.GlideClusterClient;import glide.api.models.configuration.GlideClusterClientConfiguration;import glide.api.models.configuration.NodeAddress;
GlideClusterClient config = GlideClusterClientConfiguration.builder() .address(NodeAddress.builder() .host("address.example.com") .port(6379).build()) .requestTimeout(500) .build();
GlideClusterClient client = GlideClusterClient.createClient(config).get();HashMap<String, String> stats = client.getStatistics();// do something with the `stats`