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

rpc2, debugger: Fix comments around goroutine grouping #3374

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions service/debugger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,9 +1683,16 @@ func formatLoc(loc proc.Location) string {
return fmt.Sprintf("%s:%d in %s", loc.File, loc.Line, fnname)
}

// GroupGoroutines divides goroutines in gs into groups as specified by groupBy and groupByArg.
// A maximum of maxGoroutinesPerGroup are saved in each group, but the total
// number of goroutines in each group is recorded.
// GroupGoroutines divides goroutines in gs into groups as specified by
// group.{GroupBy,GroupByKey}. A maximum of group.MaxGroupMembers are saved in
// each group, but the total number of goroutines in each group is recorded. If
// group.MaxGroups is set, then at most that many groups are returned. If some
// groups end up being dropped because of this limit, the tooManyGroups return
// value is set.
//
// The first return value represents the goroutines that have been included in
// one of the returned groups (subject to the MaxGroupMembers and MaxGroups
// limits). The second return value represents the groups.
func (d *Debugger) GroupGoroutines(gs []*proc.G, group *api.GoroutineGroupingOptions) ([]*proc.G, []api.GoroutineGroup, bool) {
if group.GroupBy == api.GoroutineFieldNone {
return gs, nil, false
Expand Down
2 changes: 1 addition & 1 deletion service/rpc2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ type ListGoroutinesOut struct {
// be grouped with the specified criterion.
// If the value of arg.GroupBy is GoroutineLabel goroutines will
// be grouped by the value of the label with key GroupByKey.
// For each group a maximum of MaxExamples example goroutines are
// For each group a maximum of MaxGroupMembers example goroutines are
// returned, as well as the total number of goroutines in the group.
func (s *RPCServer) ListGoroutines(arg ListGoroutinesIn, out *ListGoroutinesOut) error {
//TODO(aarzilli): if arg contains a running goroutines filter (not negated)
Expand Down