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