updateStats method
void
updateStats(})
override
Updates statistics for a cache operation.
Implementation
@override
void updateStats(
String driverName, {
required bool hit,
required String operation,
bool error = false,
}) {
final currentStats = _getOrCreateStats(driverName);
if (operation == 'get' || operation == 'has') {
if (hit) {
currentStats.hits++;
} else {
currentStats.misses++;
}
} else if (operation == 'put') {
currentStats.sets++;
} else if (operation == 'forget') {
currentStats.deletions++;
} else if (operation == 'clear') {
currentStats.clears++;
}
// Note: CacheStats doesn't have an errors field, so we skip error tracking for now
// This could be added to CacheStats if needed in the future
}