-
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?
Conversation
Signed-off-by: Mykhailo Kuchma <[email protected]>
/** | ||
* @brief Retrieve the accumulated statistics of the cache instance. | ||
* | ||
* @return Statistics structure. | ||
*/ | ||
virtual Statistics GetStatistics() const { return Statistics{}; } |
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.
Add to DefaultCache only!
Codecov Report
@@ Coverage Diff @@
## master #812 +/- ##
========================================
- Coverage 78.7% 78.7% -0.0%
========================================
Files 292 292
Lines 9928 9941 +13
========================================
+ Hits 7817 7823 +6
- Misses 2111 2118 +7
Continue to review full report at Codecov.
|
* @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 comment
The reason will be displayed to describe this comment to others. Learn more.
/// The number of bytes written to disk cache with Put methods. | |
/// The number of bytes written to the disk cache with the `Put` methods. |
struct Statistics { | ||
/// The number of bytes written to disk cache with Put methods. | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
/// The number of bytes read from disk cache with Get methods. | |
/// The number of bytes read from the disk cache with the `Get` methods. |
uint64_t bytes_written; | ||
/// The number of bytes read from disk cache with Get methods. | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
/// The number of bytes removed from disk cache with Remove method. | |
/// The number of bytes removed from the disk cache with the `Remove` methods. |
uint64_t bytes_read; | ||
/// The number of bytes removed from disk cache with Remove method. | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
/// The number of bytes evicted from disk cache. | |
/// The number of bytes evicted from the disk cache. |
uint64_t bytes_removed; | ||
/// The number of bytes evicted from disk cache. | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
/// The size of content stored in mutable disk cache. | |
/// The size of content stored in the mutable disk cache. |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief Retrieve the accumulated statistics of the cache instance. | |
* @brief Gets the accumulated statistics of the cache instance. |
/** | ||
* @brief Retrieve the accumulated statistics of the cache instance. | ||
* | ||
* @return Statistics structure. |
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.
* @return Statistics structure. | |
* @return The statistics structure. |
@@ -149,6 +149,9 @@ class CORE_API DefaultCache : public KeyValueCache { | |||
*/ | |||
bool RemoveKeysWithPrefix(const std::string& prefix) override; | |||
|
|||
/// Implements GetStatistics method of KeyValueCache. |
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.
/// Implements GetStatistics method of KeyValueCache. | |
/// Implements the `GetStatistics` method of `KeyValueCache`. |
Signed-off-by: Mykhailo Kuchma [email protected]