-
Notifications
You must be signed in to change notification settings - Fork 140
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
Perf[MQB]: inline stats onEvent #542
Conversation
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
0796ed0
to
982aac0
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.
Have some comments. Overall, the PR is good and is almost ready to be merged
inline void | ||
BrokerStats::onEvent<BrokerStats::EventType::Enum::e_CLIENT_CREATED>() | ||
{ | ||
BSLS_ASSERT_SAFE(d_statContext_p && "initialize was not called"); |
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.
Not in the scope of this PR, but It's a pity that we check this condition on every metric update. Would be nice to ensure initialization on construction, so Stats
classes are impossible to construct without this.
|
||
/// Namespace for the constants of stat values that applies to the queues | ||
/// on the domain | ||
struct DomainQueueStats { |
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.
Also might be a private type for QueueStatsDomain
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.
Can not make it private, because it's used in QueueStatsUtil::initializeTableAndTipDomains
My suggestion is to put struct DomainQueueStats
into public section in class QueueStatsDomain
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.
Can do it in the next PR
} break; | ||
}; | ||
} | ||
|
||
void QueueStatsDomain::onEvent(EventType::Enum type, | ||
bsls::Types::Int64 value, | ||
const bsl::string& appId) |
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.
This onEvent
(per-appId one) is not templated/inlined in this PR. It's okay, we can do it later.
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Co-authored-by: Evgeny Malygin <[email protected]> Signed-off-by: Dmitry Petukhov <[email protected]>
Co-authored-by: Evgeny Malygin <[email protected]> Signed-off-by: Dmitry Petukhov <[email protected]>
Co-authored-by: Evgeny Malygin <[email protected]> Signed-off-by: Dmitry Petukhov <[email protected]>
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.
Changes are good
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
Signed-off-by: Dmitry Petukhov <[email protected]>
9128dec
to
c233c42
Compare
Signed-off-by: Dmitry Petukhov <[email protected]>
Merged with upstream main. All workflows passed |
Describe your changes
Refactor QueueStatsDomain, DomainStats, ClusterNodeStats and BrokerStats to make function onEvent inline which supposedly should increase overall performance of the system.
Testing performed
Additional context