-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-30949 Ensure that duplicate statistics are not added to a CStatsCollection #18097
Conversation
system/jlib/jstats.cpp
Outdated
@@ -1919,6 +1919,10 @@ class CStatisticCollection : public CInterfaceOf<IStatisticCollection> | |||
//other public interface functions | |||
void addStatistic(StatisticKind kind, unsigned __int64 value) | |||
{ | |||
#if 1 //def _DEBUG |
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 will be debug only in the final PR - pushed to run the full regression suite.
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.
It would be useful to have a comment to say that addStatistic shouldn't ever add the same kind multiple times.
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.
I agree. I'll add one when I change the #if
https://track.hpccsystems.com/browse/HPCC-30949 |
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.
I think a comment on addStatistic would be useful.
system/jlib/jstats.cpp
Outdated
@@ -1919,6 +1919,10 @@ class CStatisticCollection : public CInterfaceOf<IStatisticCollection> | |||
//other public interface functions | |||
void addStatistic(StatisticKind kind, unsigned __int64 value) | |||
{ | |||
#if 1 //def _DEBUG |
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.
It would be useful to have a comment to say that addStatistic shouldn't ever add the same kind multiple times.
@shamser please sanity check the comments and the change to the #if |
system/jlib/jstats.cpp
Outdated
@@ -1917,8 +1917,15 @@ class CStatisticCollection : public CInterfaceOf<IStatisticCollection> | |||
} | |||
|
|||
//other public interface functions | |||
// addStatstic should only be used if it is known that the kind is not already there |
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.
minor: spelling addStatistic
} | ||
virtual void addStatistic(StatisticKind kind, unsigned __int64 value) override | ||
{ | ||
//Always merge rather than updating |
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.
minor: merge rather than "add"
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.
Couple of minors related to comments.
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 plausible
…Collection Signed-off-by: Gavin Halliday <[email protected]>
Fixed comments and force pushed. |
Type of change:
Checklist:
Smoketest:
Testing: