-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add database backend counters #3755
Conversation
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.
Very nice changes. Getting rid of getBackend
is a win. Left one nit.
I would have given a thumbs up, but src/ripple/nodestore/Database.h
src/ripple/nodestore/impl/DatabaseNodeImp.h
need to be reformatted. 👍 after we take care of that.
You might also want to reference the getBackend
fix that DatabaseShardImp::getCounters()
implements in the commit message.
src/ripple/nodestore/Database.h
Outdated
@@ -94,6 +92,11 @@ class Database : public Stoppable | |||
virtual std::int32_t | |||
getWriteLoad() const = 0; | |||
|
|||
/** Retrieve backend read and write stats. The return pointer may be null. | |||
*/ | |||
virtual Backend::Counters const* |
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.
We're using the pointer like an optional<Counters&>
, which I like, but we should probably add a comment saying so.
Clang format seems to be case-sensitively comparing include filenames. It wants to place #include <ripple/basics/TaggedCache.h> before #include <ripple/basics/chrono.h> There may be a way to configure it to be case-insensitive on include filenames. Clang 12 supports SI_CaseInsensitive with SortIncludes. Clang format also wants to indent the following comment end by a single space. This is avoided if it's a multi-line comment. eg.
|
Fix bug where DatabaseRotateImp::getBackend and ::sync utilized the writable backend without a lock. ::getBackend was replaced with ::getCounters.
b88519b
to
5d12f87
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.
👍 Looks good, but left one nit.
4539c60
to
85862b0
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.
Still 👍 after 85862b0 (nice cleanup there, btw).
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.
👍 Looks great to me!
I wanted to pitch an alternative technique for doing this, modeled after Specifically, let Advantages:
|
This change removes the public Database getBackend function and adds a new function that returns backend read and write stats.