MCPcopy
hub / github.com/grafana/tempo / topNInt

Function topNInt

cmd/tempo-cli/cmd-analyse-block.go:1048–1060  ·  view source on GitHub ↗
(n int, attrs map[string]*integerAttributeSummary)

Source from the content-addressed store, hash-verified

1046}
1047
1048func topNInt(n int, attrs map[string]*integerAttributeSummary) []*integerAttributeSummary {
1049 top := make([]*integerAttributeSummary, 0, len(attrs))
1050 for _, attr := range attrs {
1051 top = append(top, attr)
1052 }
1053 sort.Slice(top, func(i, j int) bool {
1054 return top[i].count > top[j].count
1055 })
1056 if len(top) > n {
1057 top = top[:n]
1058 }
1059 return top
1060}
1061
1062var _ parquetquery.GroupPredicate = (*attrStatsCollector)(nil)
1063

Callers 3

ToDedicatedColumnsMethod · 0.85
printFullSummaryFunction · 0.85
printCliArgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected