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

Fix Diagnostics performance log hint from HealthMonitor #25220

Merged

Conversation

JamesHazelcast
Copy link
Contributor

It appears the log hint boolean check is inverted - currently the hint is only shown if diagnostics are already enabled; it should be the other way around.

It appears the log hint boolean check is inverted - currently the hint is only shown if diagnostics are already enabled; it should be the other way around.
Copy link
Contributor

@gbarnett-hz gbarnett-hz left a comment

Choose a reason for hiding this comment

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

That seems confusing.

Small nitpick: maybe add test case to verify the log is presented only once when the initial state is false for hazelcast.diagnostics.enabled?

@pveentjer
Copy link
Contributor

I'm not crazy about testing logging output. So I would not go for adding such a test.

@pveentjer pveentjer merged commit 70a128c into hazelcast:master Aug 16, 2023
8 checks passed
@gbarnett-hz
Copy link
Contributor

gbarnett-hz commented Aug 16, 2023

I'm not crazy about testing logging output. So I would not go for adding such a test.

Me too; but not on the output: the invocation given that the negation in multiple points made the data flow so confusing. Would have helped any future refactoring.

@JackPGreen
Copy link
Contributor

I'm not crazy about testing logging output. So I would not go for adding such a test.

Me too; but not on the output: the invocation given that the negation in multiple points made the data flow so confusing. Would have helped any future refactoring.

I agree a test would be nice - it would’ve avoided this defect - but you’d need to decouple the check from the actual logger to assert the behaviour. And that’s quite a lot of overhead.

@pveentjer
Copy link
Contributor

pveentjer commented Aug 16, 2023

And you need to be able to control the logger which isn't always possible (or desirable) because it can make the code a lot more complex and that often isn't worth it.

@gbarnett-hz
Copy link
Contributor

Indeed, depends on context. The only thing that (and as I noted it was a 'minor nitpick') adding a test would do is clarify the side effect of the entirely confusing boolean logic.

@JamesHazelcast JamesHazelcast deleted the fix/5.4/health-monitor-hint branch September 21, 2023 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants