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

Method finishRPC

interop/xds/client/client.go:164–177  ·  view source on GitHub ↗
(rpcType string, err error)

Source from the content-addressed store, hash-verified

162}
163
164func (as *accumulatedStats) finishRPC(rpcType string, err error) {
165 as.mu.Lock()
166 defer as.mu.Unlock()
167 name := convertRPCName(rpcType)
168 if as.rpcStatusByMethod[name] == nil {
169 as.rpcStatusByMethod[name] = make(map[int32]int32)
170 }
171 as.rpcStatusByMethod[name][int32(status.Convert(err).Code())]++
172 if err != nil {
173 as.numRPCsFailedByMethod[name]++
174 return
175 }
176 as.numRPCsSucceededByMethod[name]++
177}
178
179var (
180 failOnFailedRPC = flag.Bool("fail_on_failed_rpc", false, "Fail client if any RPCs fail after first success")

Callers 1

makeOneRPCFunction · 0.80

Calls 5

ConvertFunction · 0.92
convertRPCNameFunction · 0.85
CodeMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected