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

Set reasonable GetTopChannelsRequest.max_results #14

Open
sergiitk opened this issue Dec 12, 2023 · 0 comments
Open

Set reasonable GetTopChannelsRequest.max_results #14

sergiitk opened this issue Dec 12, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sergiitk
Copy link
Member

sergiitk commented Dec 12, 2023

From channelz.proto

  // If non-zero, the server will return a page of results containing
  // at most this many items. If zero, the server will choose a
  // reasonable page size.  Must never be negative.
  int64 max_results = 2;

Looks like nodejs (unlike other langs) returns just a single channel by default:

❯ grpcurl -import-path ~dev/grpc/src/proto -proto grpc/channelz/channelz.proto -d '{"max_results": 100}' --plaintext 127.0.0.1:8079 grpc.channelz.v1.Channelz.GetTopChannels | jq '.channel | length'
2
❯ grpcurl -import-path ~dev/grpc/src/proto -proto grpc/channelz/channelz.proto -d '{"max_results": 0}' --plaintext 127.0.0.1:8079 grpc.channelz.v1.Channelz.GetTopChannels | jq '.channel | length'
1

Confirmed this behavior in grpc-nodejs v1.7.x and v1.9.x

We've never noticed it, because the framework automatically lists all pages. However, we can remove extra an RPC by setting default max_results to something like 10.

cc @murgatroid99

@sergiitk sergiitk added the enhancement New feature or request label Dec 12, 2023
@sergiitk sergiitk self-assigned this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant