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

WIP Add cache statistics #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mykhailo-kuchma
Copy link
Collaborator

Signed-off-by: Mykhailo Kuchma ext-mykhailo.kuchma@here.com

Signed-off-by: Mykhailo Kuchma <ext-mykhailo.kuchma@here.com>
Comment on lines +141 to +146
/**
* @brief Retrieve the accumulated statistics of the cache instance.
*
* @return Statistics structure.
*/
virtual Statistics GetStatistics() const { return Statistics{}; }
Copy link
Contributor

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
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #812 into master will decrease coverage by 0.0%.
The diff coverage is 46.2%.

Impacted file tree graph

@@           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     
Impacted Files Coverage Δ
...cpp-sdk-core/include/olp/core/cache/DefaultCache.h 100.0% <ø> (ø)
...pp-sdk-core/include/olp/core/cache/KeyValueCache.h 66.7% <0.0%> (-33.3%) ⬇️
olp-cpp-sdk-core/src/cache/DefaultCache.cpp 88.9% <0.0%> (-11.1%) ⬇️
olp-cpp-sdk-core/src/cache/DefaultCacheImpl.h 100.0% <ø> (ø)
olp-cpp-sdk-core/src/cache/DefaultCacheImpl.cpp 93.8% <60.0%> (-1.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 307391d...14c61e9. Read the comment docs.

* @brief The accumulated statistics for the cache.
*/
struct Statistics {
/// The number of bytes written to disk cache with Put methods.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Implements GetStatistics method of KeyValueCache.
/// Implements the `GetStatistics` method of `KeyValueCache`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants