Add cache hit/miss metrics for regex pattern cache #64
Labels
No labels
Epic
Feature Request
HOLD
audit
automerge
bug
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
release
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/regexYbot#64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Expose cache hit/miss ratios from the LRU regex cache to help operators tune
CACHE_MAX_SIZEandCACHE_TTL_MSfor their workload.Implementation
Update
utils.ts– ModifygetRegexCacheStats()to include:hits: number– Total cache hits since startmisses: number– Total cache misseshitRatio: number– Calculated ratio (hits / (hits + misses))missRatio: number– Calculated ratio (misses / (hits + misses))Update
LRUCacheclass – Add internal counters for hits and misses, increment them inget()andset()appropriately.Update
metrics.ts– Include these new stats in the/metricscommand output, e.g.:Notes