server: populate WireLength on stats.InPayload for unary RPCs (#2932)

Fixes #2692 which was incompletely fixed by #2711.

Also adds updates stats/stat_test.go to sanity check WireLength.
This commit is contained in:
ajwerner
2019-07-24 19:24:45 -04:00
committed by Menghan Li
parent 61f27c1415
commit b5748caae7
2 changed files with 17 additions and 6 deletions

View File

@ -971,10 +971,11 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
}
if sh != nil {
sh.HandleRPC(stream.Context(), &stats.InPayload{
RecvTime: time.Now(),
Payload: v,
Data: d,
Length: len(d),
RecvTime: time.Now(),
Payload: v,
WireLength: payInfo.wireLength,
Data: d,
Length: len(d),
})
}
if binlog != nil {