Skip to content

Commit

Permalink
vendor: add go-grpc-middleware
Browse files Browse the repository at this point in the history
Rebased to master PR #9994.  Fixed a Go format issue in
v3rpc/interceptor.go.  Updated vendor to include go-grpc-middleware.
  • Loading branch information
Jingyi Hu committed Aug 10, 2018
1 parent dc01734 commit 3066294
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 14 deletions.
8 changes: 6 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bill-of-materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
]
},
{
"project": "github.com/grpc-ecosystem/go-grpc-middleware/util/backoffutils",
"project": "github.com/grpc-ecosystem/go-grpc-middleware",
"licenses": [
{
"type": "Apache License 2.0",
Expand Down
21 changes: 10 additions & 11 deletions etcdserver/api/v3rpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func logUnaryRequestStats(ctx context.Context, lg *zap.Logger, info *grpc.UnaryS
remote = peerInfo.Addr.String()
}
var responseType string = info.FullMethod
var reqCount, respCount int64 = 0, 0
var reqSize, respSize int = 0, 0
var reqCount, respCount int64
var reqSize, respSize int
var reqContent string
switch _resp := resp.(type) {
case *pb.RangeResponse:
Expand Down Expand Up @@ -152,15 +152,14 @@ func logUnaryRequestStats(ctx context.Context, lg *zap.Logger, info *grpc.UnaryS
func logGenericRequestStats(lg *zap.Logger, startTime time.Time, duration time.Duration, remote string, responseType string,
reqCount int64, reqSize int, respCount int64, respSize int, reqContent string) {
if lg == nil {
plog.Debugf(
"start time = %v, " +
"time spent = %v, " +
"remote = %s, " +
"response type = %s, " +
"request count = %d, " +
"request size = %d, " +
"response count = %d, " +
"response size = %d, " +
plog.Debugf("start time = %v, "+
"time spent = %v, "+
"remote = %s, "+
"response type = %s, "+
"request count = %d, "+
"request size = %d, "+
"response count = %d, "+
"response size = %d, "+
"request content = %s",
startTime, duration, remote, responseType, reqCount, reqSize, respCount, respSize, reqContent,
)
Expand Down
183 changes: 183 additions & 0 deletions vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions vendor/github.com/grpc-ecosystem/go-grpc-middleware/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3066294

Please sign in to comment.