loading code fetching the highlighted snippet
Measure hit, miss, set, delete, and evict events as live traffic moves through a MemoryCache.
hooks for onHit, onMiss, onSet, onDelete,
and onEvict.hit rate is calculated from reads only: hits / (hits + misses).burst runs ten mixed operations so the event stream
can show hits, misses, writes, deletes, and evictions together.reset clears the counters and creates a fresh cache
with maxSize: 5 and a 30s TTL.0 hits / 0 reads
run traffic to populate the hook log