Skip to content

Commit

Permalink
stats: include message header in stats.InPayload.WireLength (#3886)
Browse files Browse the repository at this point in the history
  • Loading branch information
xstephen95x committed Sep 25, 2020
1 parent 21f897e commit e6c98a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server.go
Expand Up @@ -1175,7 +1175,7 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
sh.HandleRPC(stream.Context(), &stats.InPayload{
RecvTime: time.Now(),
Payload: v,
WireLength: payInfo.wireLength,
WireLength: payInfo.wireLength + headerLen,
Data: d,
Length: len(d),
})
Expand Down
4 changes: 2 additions & 2 deletions stream.go
Expand Up @@ -929,7 +929,7 @@ func (a *csAttempt) recvMsg(m interface{}, payInfo *payloadInfo) (err error) {
Payload: m,
// TODO truncate large payload.
Data: payInfo.uncompressedBytes,
WireLength: payInfo.wireLength,
WireLength: payInfo.wireLength + headerLen,
Length: len(payInfo.uncompressedBytes),
})
}
Expand Down Expand Up @@ -1511,7 +1511,7 @@ func (ss *serverStream) RecvMsg(m interface{}) (err error) {
Payload: m,
// TODO truncate large payload.
Data: payInfo.uncompressedBytes,
WireLength: payInfo.wireLength,
WireLength: payInfo.wireLength + headerLen,
Length: len(payInfo.uncompressedBytes),
})
}
Expand Down

0 comments on commit e6c98a4

Please sign in to comment.