getAllStats method

Future<Map<String, CacheStats>> getAllStats()

Get cache statistics for all instances

Implementation

Future<Map<String, CacheStats>> getAllStats() async {
  final stats = <String, CacheStats>{};

  if (_memoryCache != null) {
    stats['memory'] = await _memoryCache!.getStats();
  }
  if (_persistentCache != null) {
    stats['persistent'] = await _persistentCache!.getStats();
  }
  if (_apiCache != null) {
    stats['api'] = await _apiCache!.getStats();
  }
  if (_userDataCache != null) {
    stats['userData'] = await _userDataCache!.getStats();
  }

  return stats;
}