Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

orca: allow a ServerMetricsProvider to be passed to the ORCA service and ServerOption#6223

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dfawley merged 2 commits intogrpc:masterfromdfawley:orca
May 2, 2023

Conversation

dfawley
Copy link
Member

@dfawleydfawley commentedApr 25, 2023
edited
Loading

This is a pretty significant amount of churn but nomajor new functionality.

  1. Rename...Metric... to...Metrics... in the names of things.
  2. Renamecall_metric_recorder.go tocall_metrics.go (and_test equivalent).
  3. Move parts oforca.go to new fileserver_metrics.go.
  4. RenameUtilization in setter toNamedUtilization to match C++.
  5. AddQPS,EPS, andNamedMetrics fields and setters/getters.
  6. Split Server/Call metrics into oneServerMetrics provider & Server/Call recorders.
  7. Accept aServerMetricsProvider forNewService/Register andCallMetricsServerOption.
  8. Update examples accordingly.

Note that there are several API changes here, but this package is still experimental so it is allowable.

This brings us up to spec for theupdates ingRFC A51, and is needed forA58.

RELEASE NOTES:

  • orca: allow a ServerMetricsProvider to be passed to the ORCA service and ServerOption

@dfawleydfawley added the Type: API ChangeBreaking API changes (experimental APIs only!) labelApr 25, 2023
@dfawleydfawley added this to the1.56 Release milestoneApr 25, 2023
@dfawleydfawley requested a review fromeaswarsApril 25, 2023 21:27
@dfawleydfawley mentioned this pull requestMay 1, 2023
Copy link
Contributor

@easwarseaswars left a comment

Choose a reason for hiding this comment

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

LGTM.

Sorry for the delay. It took a long time to warm up to the new API, with the confusion between call metrics and server metrics.

type callMetricsRecorderCtxKey struct{}

// CallMetricsRecorderFromContext returns the RPC specific custom metrics
// recorder [CallMetricsRecorder] embedded in the provided RPC context.
Copy link
Contributor

Choose a reason for hiding this comment

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

The text inside[] does not appear as links in the godoc. Are we missing something?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm, IDK, I just renamed this file and made minor edits for the new names. I think you wrote the docstring originally. 😛

Deleted.


b, err := proto.Marshal(sm.toLoadReportProto())
if err != nil {
logger.Warningf("failed to marshal load report: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: s/failed/Failed/, here and two lines below.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done.

}
return service, nil
}

// Register creates a new ORCA service implementation configured using the
// provided options and registers the same on the provided service registrar.
func Register(s *grpc.Server, opts ServiceOptions)(*Service,error) {
func Register(s *grpc.Server, opts ServiceOptions) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that this is existing code, but should/could we accept agrpc.ServiceRegistrar instead? If not, maybe we should fix the docstring.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We needed the ORCA protos to be regenerated for this:

cncf/xds#41

Updated the comment.

easwars reacted with thumbs up emoji
func (s *serverMetricsRecorder) ServerMetrics() *ServerMetrics {
s.mu.Lock()
defer s.mu.Unlock()
ret := &ServerMetrics{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: return the value directly from this line.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done.

@easwarseaswars assigneddfawley and unassignedeaswarsMay 2, 2023
Copy link
MemberAuthor

@dfawleydfawley left a comment

Choose a reason for hiding this comment

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

Comments addressed; thanks!

type callMetricsRecorderCtxKey struct{}

// CallMetricsRecorderFromContext returns the RPC specific custom metrics
// recorder [CallMetricsRecorder] embedded in the provided RPC context.
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm, IDK, I just renamed this file and made minor edits for the new names. I think you wrote the docstring originally. 😛

Deleted.


b, err := proto.Marshal(sm.toLoadReportProto())
if err != nil {
logger.Warningf("failed to marshal load report: %v", err)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done.

func (s *serverMetricsRecorder) ServerMetrics() *ServerMetrics {
s.mu.Lock()
defer s.mu.Unlock()
ret := &ServerMetrics{
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done.

}
return service, nil
}

// Register creates a new ORCA service implementation configured using the
// provided options and registers the same on the provided service registrar.
func Register(s *grpc.Server, opts ServiceOptions)(*Service,error) {
func Register(s *grpc.Server, opts ServiceOptions) error {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We needed the ORCA protos to be regenerated for this:

cncf/xds#41

Updated the comment.

easwars reacted with thumbs up emoji
@easwars
Copy link
Contributor

LGTM

@dfawleydfawley merged commitadd9015 intogrpc:masterMay 2, 2023
@dfawleydfawley deleted the orca branchMay 2, 2023 22:04
tobotg pushed a commit to tobotg/grpc-go that referenced this pull requestMay 3, 2023
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsOct 30, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@easwarseaswarseaswars approved these changes

Assignees

@dfawleydfawley

Labels
Type: API ChangeBreaking API changes (experimental APIs only!)
Projects
None yet
Milestone
1.56 Release
Development

Successfully merging this pull request may close these issues.

2 participants
@dfawley@easwars

[8]ページ先頭

©2009-2025 Movatter.jp