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

Method KeepGroup

cmd/tempo-cli/cmd-analyse-block.go:1102–1140  ·  view source on GitHub ↗
(res *parquetquery.IteratorResult)

Source from the content-addressed store, hash-verified

1100}
1101
1102func (a attrStatsCollector) KeepGroup(res *parquetquery.IteratorResult) bool {
1103 var stats *attrStats
1104
1105 for _, e := range res.OtherEntries {
1106 if s, ok := e.Value.(*attrStats); ok {
1107 stats = s
1108 break
1109 }
1110 }
1111
1112 if stats == nil {
1113 stats = getStats()
1114 }
1115
1116 for _, e := range res.Entries {
1117 switch e.Key {
1118 case "key":
1119 stats.name = e.Value.String()
1120 case "value":
1121 stats.typ = attrTypeString
1122 stats.value = e.Value.String()
1123 stats.bytes += uint64(len(stats.value))
1124 case "int":
1125 stats.typ = attrTypeInt
1126 stats.intValue = e.Value.Int64()
1127 case "isArray":
1128 stats.isArray = e.Value.Boolean()
1129 }
1130 }
1131
1132 res.Reset()
1133 if stats.typ == attrTypeNull {
1134 putStats(stats)
1135 return false
1136 }
1137
1138 res.AppendOtherValue("stats", stats)
1139 return true
1140}

Callers

nothing calls this directly

Calls 5

getStatsFunction · 0.85
putStatsFunction · 0.85
AppendOtherValueMethod · 0.80
ResetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected