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

[ISSUE #6572] add client info for OperatorController metrics interface #6576

Merged
merged 2 commits into from
Aug 9, 2021

Conversation

MajorHe1
Copy link
Collaborator

@MajorHe1 MajorHe1 commented Aug 5, 2021

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

fix #6572

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@@ -105,7 +103,7 @@ private ClientManager getClientManagerById(String clientId) {
if (isConnectionBasedClient(clientId)) {
return connectionBasedClientManager;
}
return clientId.endsWith(SUFFIX) ? persistentIpPortClientManager : ephemeralIpPortClientManager;
return clientId.endsWith(IpPortBasedClient.PERSISTENT_SUFFIX) ? persistentIpPortClientManager : ephemeralIpPortClientManager;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to move SUFFIX to IpPortBasedClient

Copy link
Collaborator Author

@MajorHe1 MajorHe1 Aug 6, 2021

Choose a reason for hiding this comment

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

If we don't move SUFFIX to IpPortBasedClient, we should declare another variable named SUFFIX in OperatorController to judge whether clientId is persistent clientId.
So I think PERSISTENT_SUFFIX is a property of IpPortBasedClient.
Otherwise, we should change SUFFIX from private to public, in order that OperatorController can reference it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move it to ClientConstants?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And replace all false with same meaning usage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Move it to ClientConstants is a good choice.
It seems that persistent clientId judgement is only occurs in ClientManagerDelegate and OperatorController so far.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we move ID_DELIMITER from IpPortBasedClient to ClientConstants too?

@KomachiSion KomachiSion added the kind/enhancement Category issues or prs related to enhancement. label Aug 9, 2021
@KomachiSion KomachiSion added this to the 2.1.0 milestone Aug 9, 2021
@KomachiSion KomachiSion merged commit 0b15090 into alibaba:develop Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[nacos 2.0.3] add client info for OperatorController metrics interface
2 participants