Skip to content
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

Optionally keep Hit/Miss metric using prometheus #41

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
count for cache hit/miss also for contains
RCasatta committed Sep 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f0131a743b498e6fb7be7e322e2cfaff8973fd6a
2 changes: 1 addition & 1 deletion src/slice_cache.rs
Original file line number Diff line number Diff line change
@@ -171,7 +171,7 @@ impl<K: Hash + PartialEq + Eq + core::fmt::Debug> SliceCache<K> {

/// Return wether the cache contains the given key
pub fn contains(&self, key: &K) -> bool {
self.indexes.get(key).is_some()
self.get(key).is_some()
}

#[cfg(feature = "redb")]