From dad9308fa3c8bce6a801a4723ac2664aca476c5d Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 28 Apr 2016 16:02:27 -0700 Subject: [PATCH] Address review comments --- benchmark/benchmark.go | 4 ++++ benchmark/grpc_testing/control.proto | 2 +- benchmark/grpc_testing/messages.proto | 3 +-- benchmark/grpc_testing/payloads.proto | 2 +- benchmark/grpc_testing/services.proto | 2 +- benchmark/grpc_testing/stats.proto | 6 +++--- benchmark/stats/histogram.go | 1 + 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index 56e2b78f..208a5431 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -173,6 +173,10 @@ func DoStreamingRoundTrip(stream testpb.BenchmarkService_StreamingCallClient, re return grpc.Errorf(grpc.Code(err), "StreamingCall(_).Send: %v", grpc.ErrorDesc(err)) } if _, err := stream.Recv(); err != nil { + // EOF should be a valid error here. + if err == io.EOF { + return nil + } return grpc.Errorf(grpc.Code(err), "StreamingCall(_).Recv: %v", grpc.ErrorDesc(err)) } return nil diff --git a/benchmark/grpc_testing/control.proto b/benchmark/grpc_testing/control.proto index 4913c86a..e0fe0ec7 100644 --- a/benchmark/grpc_testing/control.proto +++ b/benchmark/grpc_testing/control.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/benchmark/grpc_testing/messages.proto b/benchmark/grpc_testing/messages.proto index a063b470..b1abc9e8 100644 --- a/benchmark/grpc_testing/messages.proto +++ b/benchmark/grpc_testing/messages.proto @@ -1,5 +1,4 @@ - -// Copyright 2015-2016, Google Inc. +// Copyright 2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/benchmark/grpc_testing/payloads.proto b/benchmark/grpc_testing/payloads.proto index 7e5b2c61..056fe0c7 100644 --- a/benchmark/grpc_testing/payloads.proto +++ b/benchmark/grpc_testing/payloads.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/benchmark/grpc_testing/services.proto b/benchmark/grpc_testing/services.proto index 19b55c31..c2acca7f 100644 --- a/benchmark/grpc_testing/services.proto +++ b/benchmark/grpc_testing/services.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/benchmark/grpc_testing/stats.proto b/benchmark/grpc_testing/stats.proto index f9d11611..9bc3cb21 100644 --- a/benchmark/grpc_testing/stats.proto +++ b/benchmark/grpc_testing/stats.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -45,8 +45,8 @@ message ServerStats { // Histogram params based on grpc/support/histogram.c message HistogramParams { - double resolution = 1; // first bucket is [0, 1 + resolution) - double max_possible = 2; // use enough buckets to allow this value + double resolution = 1; // first bucket is [0, 1 + resolution) + double max_possible = 2; // use enough buckets to allow this value } // Histogram data based on grpc/support/histogram.c diff --git a/benchmark/stats/histogram.go b/benchmark/stats/histogram.go index 13bde953..36dbc4fa 100644 --- a/benchmark/stats/histogram.go +++ b/benchmark/stats/histogram.go @@ -145,6 +145,7 @@ func NewHistogram(opts HistogramOptions) *Histogram { return &h } +// Clear resets all the content of histogram. func (h *Histogram) Clear() { h.count = newCounter() h.sum = newCounter()