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

xds/internal/balancer/outlierdetection: Change string to String #6222

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

zasweq
Copy link
Contributor

@zasweq zasweq commented Apr 25, 2023

This PR changes string() helper methods to String(), thus implementing a fmt.Stringer() interface and automatically being called by the format package.

RELEASE NOTES: N/A

@zasweq zasweq requested a review from dfawley April 25, 2023 17:52
@zasweq zasweq requested review from easwars and removed request for dfawley April 25, 2023 17:52
@zasweq zasweq assigned easwars and unassigned dfawley Apr 25, 2023
@zasweq
Copy link
Contributor Author

zasweq commented Apr 25, 2023

Follow up on #6145.

@zasweq zasweq added the Type: Internal Cleanup Refactors, etc label Apr 25, 2023
@zasweq zasweq added this to the 1.55 Release milestone Apr 25, 2023
Comment on lines 831 to 832
channelz.Infof(logger, b.channelzParentID, "SuccessRate algorithm detected outlier: %s. Parameters: successRate=%f, mean=%f, stddev=%f, requiredSuccessRate=%f",
addrInfo.string(), successRate, mean, stddev, requiredSuccessRate)
addrInfo, successRate, mean, stddev, requiredSuccessRate)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, do we have an idea how this line appears in the log? Like, I don't know if the addrInfo is readable in the logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, this was leftovers from the fact he did it in Java first. Switched.

Copy link
Contributor Author

@zasweq zasweq Apr 26, 2023

Choose a reason for hiding this comment

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

Logs look like
FailurePercentage algorithm detected outlier: [[{ "Addr": "localhost:60860", "ServerName": "", "Attributes": {}, "BalancerAttributes": {}, "Type": 0, "Metadata": null }]], failurePercentage=100.000000
This looks good, and as you will see in my upcoming wrr_locality PR I changed this String() method on the address (eventually gets called through scw.String() and formatting directive there) to be much more readable all the way down to the Balancer Attributes/Attributes layer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

xds/internal/balancer/outlierdetection/balancer.go Outdated Show resolved Hide resolved
@easwars easwars assigned zasweq and unassigned easwars Apr 25, 2023
@zasweq zasweq assigned easwars and unassigned zasweq Apr 26, 2023
@easwars easwars assigned zasweq and unassigned easwars Apr 26, 2023
@zasweq zasweq merged commit 497436c into grpc:master Apr 26, 2023
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants