getCacheStats abstract method

ClassLoaderStats getCacheStats()

Gets cache statistics for monitoring and optimization.

Returns:

Available Metrics

  • Hit Rate: Percentage of cache hits vs misses
  • Cache Sizes: Number of entries in each cache category
  • Memory Usage: Estimated memory consumption
  • Load Times: Average class loading performance

Example

final stats = loader.getCacheStats();
print('Cache hit rate: ${stats.hitRate}%');
print('Classes cached: ${stats.classCount}');
print('Memory usage: ${stats.memoryUsage} bytes');

Monitoring Use Cases

  • Performance tuning and optimization
  • Memory usage tracking
  • Cache efficiency analysis
  • Capacity planning

Implementation

ClassLoaderStats getCacheStats();