Skip to content

Commit

Permalink
remove WireLength fix for InPayload calc
Browse files Browse the repository at this point in the history
grpc fixes it in grpc/grpc-go#3886
  • Loading branch information
vadimi committed Oct 9, 2020
1 parent c17d8aa commit 75de31f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions internal/rpc/stats.go
Expand Up @@ -31,10 +31,7 @@ func (s *Stats) record(rpcStats stats.RPCStats) {
case *stats.InHeader:
atomic.AddInt64(&s.respSize, int64(v.WireLength))
case *stats.InPayload:
// TODO(spencer): remove the +5 offset on wire length here, which
// is a temporary stand-in for the missing GRPC framing offset.
// See: https://github.com/grpc/grpc-go/issues/1647.
atomic.AddInt64(&s.respSize, int64(v.WireLength+5))
atomic.AddInt64(&s.respSize, int64(v.WireLength))
case *stats.InTrailer:
atomic.AddInt64(&s.respSize, int64(v.WireLength))
case *stats.OutHeader:
Expand Down
2 changes: 1 addition & 1 deletion internal/rpc/stats_test.go
Expand Up @@ -52,7 +52,7 @@ func TestRPCStatsRecording(t *testing.T) {
t.Errorf("invalid req size: %d, expected: %d", s.ReqSize(), expectedReqSize)
}

expectedRespSize := int64(11)
expectedRespSize := int64(6)
if s.RespSize() != expectedRespSize {
t.Errorf("invalid resp size: %d, expected: %d", s.RespSize(), expectedRespSize)
}
Expand Down

0 comments on commit 75de31f

Please sign in to comment.