mirror of https://github.com/grpc/grpc-go.git
stats: include message header in stats.InPayload.WireLength (#3886)
This commit is contained in:
parent
21f897eab8
commit
e6c98a478e
|
|
@ -1175,7 +1175,7 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
|
||||||
sh.HandleRPC(stream.Context(), &stats.InPayload{
|
sh.HandleRPC(stream.Context(), &stats.InPayload{
|
||||||
RecvTime: time.Now(),
|
RecvTime: time.Now(),
|
||||||
Payload: v,
|
Payload: v,
|
||||||
WireLength: payInfo.wireLength,
|
WireLength: payInfo.wireLength + headerLen,
|
||||||
Data: d,
|
Data: d,
|
||||||
Length: len(d),
|
Length: len(d),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -929,7 +929,7 @@ func (a *csAttempt) recvMsg(m interface{}, payInfo *payloadInfo) (err error) {
|
||||||
Payload: m,
|
Payload: m,
|
||||||
// TODO truncate large payload.
|
// TODO truncate large payload.
|
||||||
Data: payInfo.uncompressedBytes,
|
Data: payInfo.uncompressedBytes,
|
||||||
WireLength: payInfo.wireLength,
|
WireLength: payInfo.wireLength + headerLen,
|
||||||
Length: len(payInfo.uncompressedBytes),
|
Length: len(payInfo.uncompressedBytes),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1511,7 +1511,7 @@ func (ss *serverStream) RecvMsg(m interface{}) (err error) {
|
||||||
Payload: m,
|
Payload: m,
|
||||||
// TODO truncate large payload.
|
// TODO truncate large payload.
|
||||||
Data: payInfo.uncompressedBytes,
|
Data: payInfo.uncompressedBytes,
|
||||||
WireLength: payInfo.wireLength,
|
WireLength: payInfo.wireLength + headerLen,
|
||||||
Length: len(payInfo.uncompressedBytes),
|
Length: len(payInfo.uncompressedBytes),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue