Skip to main content
stats() returns a dict describing the current state of the SDK’s local cache: how many entries it holds across all backends, total storage footprint, and a per-backend breakdown. Use it to verify your cache configuration is taking effect, to monitor cache size in production, or to debug stale-data issues during development. This is a synchronous method, no await. If the cache manager is not initialized (e.g., caching disabled in SDKConfig), the returned dict is {"enabled": False}.

Parameters

This method takes no parameters.

Returns

A dict[str, Any] describing cache state.
bool
Whether the local cache is active. False indicates no other fields will be present.
str
The client identifier the cache is scoped to.
str
Filesystem path where cache backends store their data.
int
Total number of entries summed across all backends.
int
Total storage footprint in bytes, summed across all backends.
List[Dict[str, Any]]
Per-backend stats. Each entry has a key (backend identifier) plus that backend’s own metrics (entry_count, total_bytes, and any backend-specific fields).

Example

Raises

This method does not raise SDK errors. See Error Codes for the full SDK exception hierarchy.

See also