-
Notifications
You must be signed in to change notification settings - Fork 365
chore: add metrics and tests to all cache implementations #2874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (74.88%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2874 +/- ##
===========================================
+ Coverage 50.02% 74.88% +24.87%
===========================================
Files 416 484 +68
Lines 51735 57869 +6134
===========================================
+ Hits 25873 43328 +17455
+ Misses 23288 11506 -11782
- Partials 2574 3035 +461 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f0c44c8 to
07633a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this is the one used in prod today
tstirrat15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but see question about otter
| } | ||
|
|
||
| cache := wrapped[K, V]{name, config, config.DefaultTTL, rcache} | ||
| cache := ristretoCache[K, V]{name, config, config.DefaultTTL, rcache} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cache := ristretoCache[K, V]{name, config, config.DefaultTTL, rcache} | |
| cache := ristrettoCache[K, V]{name, config, config.DefaultTTL, rcache} |
Plus other updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow-up PR :D
| } | ||
|
|
||
| wtc.metrics.costAdded.Add(uint64(uintCost)) | ||
| _, ok := wtc.Get(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a meaningful difference between Otter and Ristretto such that this bookkeeping isn't required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generally i think the semantics of this entire Cache interface are unclear. What is Set supposed to return if the key exists?
Theine overwrites.
Otter fails if it already exists.
Ristretto overwrites, i think.
I don't know how the callers expect Set to behave to say how each impl should behave.
07633a8 to
c02161f
Compare
c02161f to
0393250
Compare
No description provided.