Tracking resources
GLIDE 1.2 introduces a new NONE Valkey API: getStatistics which returns a Dict 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)
from glide import ( NodeAddress, GlideClusterClientConfiguration, GlideClusterClient)
addresses = [NodeAddress(host="address.example.com", port=6379)]client_config = GlideClusterClientConfiguration(addresses, request_timeout=500)
client = await GlideClusterClient.create(client_config)
# Retrieve statisticsstats = await client.get_statistics()
# Example: Accessing and printing statisticsprint(f"Total Connections: {stats['total_connections']}")print(f"Total Clients: {stats['total_clients']}")