MCPcopy
hub / github.com/grpc/grpc-go / SharedFeatures

Method SharedFeatures

benchmark/stats/stats.go:165–179  ·  view source on GitHub ↗

SharedFeatures returns the shared features as a pretty printable string. 'wantFeatures' is a bitmask of wanted features, indexed by FeaturesIndex.

(wantFeatures []bool)

Source from the content-addressed store, hash-verified

163// SharedFeatures returns the shared features as a pretty printable string.
164// 'wantFeatures' is a bitmask of wanted features, indexed by FeaturesIndex.
165func (f Features) SharedFeatures(wantFeatures []bool) string {
166 var b bytes.Buffer
167 if f.NetworkMode != "" {
168 b.WriteString(fmt.Sprintf("Network: %v\n", f.NetworkMode))
169 }
170 if f.UseBufConn {
171 b.WriteString(fmt.Sprintf("UseBufConn: %v\n", f.UseBufConn))
172 }
173 if f.EnableKeepalive {
174 b.WriteString(fmt.Sprintf("EnableKeepalive: %v\n", f.EnableKeepalive))
175 }
176 b.WriteString(fmt.Sprintf("BenchTime: %v\n", f.BenchTime))
177 f.partialString(&b, wantFeatures, ": ", "\n")
178 return b.String()
179}
180
181// PrintableName returns a one line name which includes the features specified
182// by 'wantFeatures' which is a bitmask of wanted features, indexed by

Callers 1

formatBenchmarkFunction · 0.80

Calls 2

partialStringMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected