-
Notifications
You must be signed in to change notification settings - Fork 43
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
WIP Add cache statistics #812
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -57,6 +57,22 @@ class CORE_API KeyValueCache { | |||||
*/ | ||||||
using ValueTypePtr = std::shared_ptr<ValueType>; | ||||||
|
||||||
/** | ||||||
* @brief The accumulated statistics for the cache. | ||||||
*/ | ||||||
struct Statistics { | ||||||
/// The number of bytes written to disk cache with Put methods. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint64_t bytes_written; | ||||||
/// The number of bytes read from disk cache with Get methods. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint64_t bytes_read; | ||||||
/// The number of bytes removed from disk cache with Remove method. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint64_t bytes_removed; | ||||||
/// The number of bytes evicted from disk cache. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint64_t bytes_evicted; | ||||||
/// The size of content stored in mutable disk cache. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
uint64_t data_size; | ||||||
}; | ||||||
|
||||||
virtual ~KeyValueCache() = default; | ||||||
|
||||||
/** | ||||||
|
@@ -121,6 +137,13 @@ class CORE_API KeyValueCache { | |||||
* @return True if the values are removed; false otherwise. | ||||||
*/ | ||||||
virtual bool RemoveKeysWithPrefix(const std::string& prefix) = 0; | ||||||
|
||||||
/** | ||||||
* @brief Retrieve the accumulated statistics of the cache instance. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* | ||||||
* @return Statistics structure. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
*/ | ||||||
virtual Statistics GetStatistics() const { return Statistics{}; } | ||||||
Comment on lines
+141
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add to DefaultCache only! |
||||||
}; | ||||||
|
||||||
} // namespace cache | ||||||
|
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.