mirror of https://github.com/grpc/grpc-go.git
Modify comments
This commit is contained in:
parent
a0ea2d2050
commit
78994035bc
|
@ -91,7 +91,8 @@ func setupClientEnv(config *testpb.ClientConfig) {
|
|||
}
|
||||
|
||||
// createConns creates connections according to given config.
|
||||
// It returns a slice of connections created, the function to close all connections, and errors if any.
|
||||
// It returns the connections and corresponding function to close them.
|
||||
// It returns non-nil error if there is anything wrong.
|
||||
func createConns(config *testpb.ClientConfig) ([]*grpc.ClientConn, func(), error) {
|
||||
var opts []grpc.DialOption
|
||||
|
||||
|
@ -222,7 +223,6 @@ func (bc *benchmarkClient) doCloseLoopUnary(conns []*grpc.ClientConn, rpcCountPe
|
|||
for _, conn := range conns {
|
||||
client := testpb.NewBenchmarkServiceClient(conn)
|
||||
// For each connection, create rpcCountPerConn goroutines to do rpc.
|
||||
// Close this connection after all goroutines finish.
|
||||
for j := 0; j < rpcCountPerConn; j++ {
|
||||
go func() {
|
||||
// TODO: do warm up if necessary.
|
||||
|
@ -269,7 +269,6 @@ func (bc *benchmarkClient) doCloseLoopStreaming(conns []*grpc.ClientConn, rpcCou
|
|||
}
|
||||
for _, conn := range conns {
|
||||
// For each connection, create rpcCountPerConn goroutines to do rpc.
|
||||
// Close this connection after all goroutines finish.
|
||||
for j := 0; j < rpcCountPerConn; j++ {
|
||||
c := testpb.NewBenchmarkServiceClient(conn)
|
||||
stream, err := c.StreamingCall(context.Background())
|
||||
|
|
|
@ -140,7 +140,7 @@ func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchma
|
|||
return nil, grpc.Errorf(codes.InvalidArgument, "unknow payload config: %v", config.PayloadConfig)
|
||||
}
|
||||
} else {
|
||||
// Start protobuf server is payload config is nil.
|
||||
// Start protobuf server if payload config is nil.
|
||||
addr, closeFunc = benchmark.StartServer(benchmark.ServerInfo{
|
||||
Addr: ":" + strconv.Itoa(port),
|
||||
Type: "protobuf",
|
||||
|
|
|
@ -229,6 +229,8 @@ func main() {
|
|||
|
||||
go func() {
|
||||
<-stop
|
||||
// Wait for 1 second before stopping the server to make sure the return value of QuitWorker is sent to client.
|
||||
// TODO revise this once server graceful stop is supported in gRPC.
|
||||
time.Sleep(time.Second)
|
||||
s.Stop()
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue