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

Struct countingProtoCodec

encoding/encoding_test.go:270–276  ·  view source on GitHub ↗

countingProtoCodec wraps the proto codec and counts the number of times Marshal and Unmarshal are called.

Source from the content-addressed store, hash-verified

268// countingProtoCodec wraps the proto codec and counts the number of times
269// Marshal and Unmarshal are called.
270type countingProtoCodec struct {
271 name string
272
273 // The following fields are accessed atomically.
274 marshalCount int32
275 unmarshalCount int32
276}
277
278func (p *countingProtoCodec) Marshal(v any) (mem.BufferSlice, error) {
279 atomic.AddInt32(&p.marshalCount, 1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected