Fix "deprecated" function godoc comments to match standard formatting (#2027)
This commit is contained in:
Родитель
e538e04cad
Коммит
f8dbc38bdc
|
@ -104,7 +104,7 @@ func closeLoopUnary() {
|
|||
close(ch)
|
||||
wg.Wait()
|
||||
conn.Close()
|
||||
grpclog.Println(s.String())
|
||||
grpclog.Infoln(s.String())
|
||||
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ func closeLoopStream() {
|
|||
close(ch)
|
||||
wg.Wait()
|
||||
conn.Close()
|
||||
grpclog.Println(s.String())
|
||||
grpclog.Infoln(s.String())
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -166,7 +166,7 @@ func main() {
|
|||
if err != nil {
|
||||
grpclog.Fatalf("Failed to listen: %v", err)
|
||||
}
|
||||
grpclog.Println("Client profiling address: ", lis.Addr().String())
|
||||
grpclog.Infoln("Client profiling address: ", lis.Addr().String())
|
||||
if err := http.Serve(lis, nil); err != nil {
|
||||
grpclog.Fatalf("Failed to serve: %v", err)
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ func main() {
|
|||
if err != nil {
|
||||
grpclog.Fatalf("Failed to listen: %v", err)
|
||||
}
|
||||
grpclog.Println("Server profiling address: ", lis.Addr().String())
|
||||
grpclog.Infoln("Server profiling address: ", lis.Addr().String())
|
||||
if err := http.Serve(lis, nil); err != nil {
|
||||
grpclog.Fatalf("Failed to serve: %v", err)
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ func main() {
|
|||
}
|
||||
addr := lis.Addr().String()
|
||||
stopper := benchmark.StartServer(benchmark.ServerInfo{Type: "protobuf", Listener: lis}) // listen on all interfaces
|
||||
grpclog.Println("Server Address: ", addr)
|
||||
grpclog.Infoln("Server Address: ", addr)
|
||||
<-time.After(time.Duration(*duration) * time.Second)
|
||||
stopper()
|
||||
}
|
||||
|
|
|
@ -81,20 +81,20 @@ func printClientConfig(config *testpb.ClientConfig) {
|
|||
// will always create sync client
|
||||
// - async client threads.
|
||||
// - core list
|
||||
grpclog.Printf(" * client type: %v (ignored, always creates sync client)", config.ClientType)
|
||||
grpclog.Printf(" * async client threads: %v (ignored)", config.AsyncClientThreads)
|
||||
grpclog.Infof(" * client type: %v (ignored, always creates sync client)", config.ClientType)
|
||||
grpclog.Infof(" * async client threads: %v (ignored)", config.AsyncClientThreads)
|
||||
// TODO: use cores specified by CoreList when setting list of cores is supported in go.
|
||||
grpclog.Printf(" * core list: %v (ignored)", config.CoreList)
|
||||
grpclog.Infof(" * core list: %v (ignored)", config.CoreList)
|
||||
|
||||
grpclog.Printf(" - security params: %v", config.SecurityParams)
|
||||
grpclog.Printf(" - core limit: %v", config.CoreLimit)
|
||||
grpclog.Printf(" - payload config: %v", config.PayloadConfig)
|
||||
grpclog.Printf(" - rpcs per chann: %v", config.OutstandingRpcsPerChannel)
|
||||
grpclog.Printf(" - channel number: %v", config.ClientChannels)
|
||||
grpclog.Printf(" - load params: %v", config.LoadParams)
|
||||
grpclog.Printf(" - rpc type: %v", config.RpcType)
|
||||
grpclog.Printf(" - histogram params: %v", config.HistogramParams)
|
||||
grpclog.Printf(" - server targets: %v", config.ServerTargets)
|
||||
grpclog.Infof(" - security params: %v", config.SecurityParams)
|
||||
grpclog.Infof(" - core limit: %v", config.CoreLimit)
|
||||
grpclog.Infof(" - payload config: %v", config.PayloadConfig)
|
||||
grpclog.Infof(" - rpcs per chann: %v", config.OutstandingRpcsPerChannel)
|
||||
grpclog.Infof(" - channel number: %v", config.ClientChannels)
|
||||
grpclog.Infof(" - load params: %v", config.LoadParams)
|
||||
grpclog.Infof(" - rpc type: %v", config.RpcType)
|
||||
grpclog.Infof(" - histogram params: %v", config.HistogramParams)
|
||||
grpclog.Infof(" - server targets: %v", config.ServerTargets)
|
||||
}
|
||||
|
||||
func setupClientEnv(config *testpb.ClientConfig) {
|
||||
|
|
|
@ -59,15 +59,15 @@ func printServerConfig(config *testpb.ServerConfig) {
|
|||
// will always start sync server
|
||||
// - async server threads
|
||||
// - core list
|
||||
grpclog.Printf(" * server type: %v (ignored, always starts sync server)", config.ServerType)
|
||||
grpclog.Printf(" * async server threads: %v (ignored)", config.AsyncServerThreads)
|
||||
grpclog.Infof(" * server type: %v (ignored, always starts sync server)", config.ServerType)
|
||||
grpclog.Infof(" * async server threads: %v (ignored)", config.AsyncServerThreads)
|
||||
// TODO: use cores specified by CoreList when setting list of cores is supported in go.
|
||||
grpclog.Printf(" * core list: %v (ignored)", config.CoreList)
|
||||
grpclog.Infof(" * core list: %v (ignored)", config.CoreList)
|
||||
|
||||
grpclog.Printf(" - security params: %v", config.SecurityParams)
|
||||
grpclog.Printf(" - core limit: %v", config.CoreLimit)
|
||||
grpclog.Printf(" - port: %v", config.Port)
|
||||
grpclog.Printf(" - payload config: %v", config.PayloadConfig)
|
||||
grpclog.Infof(" - security params: %v", config.SecurityParams)
|
||||
grpclog.Infof(" - core limit: %v", config.CoreLimit)
|
||||
grpclog.Infof(" - port: %v", config.Port)
|
||||
grpclog.Infof(" - payload config: %v", config.PayloadConfig)
|
||||
}
|
||||
|
||||
func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchmarkServer, error) {
|
||||
|
@ -147,7 +147,7 @@ func startBenchmarkServer(config *testpb.ServerConfig, serverPort int) (*benchma
|
|||
}, opts...)
|
||||
}
|
||||
|
||||
grpclog.Printf("benchmark server listening at %v", addr)
|
||||
grpclog.Infof("benchmark server listening at %v", addr)
|
||||
addrSplitted := strings.Split(addr, ":")
|
||||
p, err := strconv.Atoi(addrSplitted[len(addrSplitted)-1])
|
||||
if err != nil {
|
||||
|
|
|
@ -79,7 +79,7 @@ func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) er
|
|||
var bs *benchmarkServer
|
||||
defer func() {
|
||||
// Close benchmark server when stream ends.
|
||||
grpclog.Printf("closing benchmark server")
|
||||
grpclog.Infof("closing benchmark server")
|
||||
if bs != nil {
|
||||
bs.closeFunc()
|
||||
}
|
||||
|
@ -96,9 +96,9 @@ func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) er
|
|||
var out *testpb.ServerStatus
|
||||
switch argtype := in.Argtype.(type) {
|
||||
case *testpb.ServerArgs_Setup:
|
||||
grpclog.Printf("server setup received:")
|
||||
grpclog.Infof("server setup received:")
|
||||
if bs != nil {
|
||||
grpclog.Printf("server setup received when server already exists, closing the existing server")
|
||||
grpclog.Infof("server setup received when server already exists, closing the existing server")
|
||||
bs.closeFunc()
|
||||
}
|
||||
bs, err = startBenchmarkServer(argtype.Setup, s.serverPort)
|
||||
|
@ -112,8 +112,8 @@ func (s *workerServer) RunServer(stream testpb.WorkerService_RunServerServer) er
|
|||
}
|
||||
|
||||
case *testpb.ServerArgs_Mark:
|
||||
grpclog.Printf("server mark received:")
|
||||
grpclog.Printf(" - %v", argtype)
|
||||
grpclog.Infof("server mark received:")
|
||||
grpclog.Infof(" - %v", argtype)
|
||||
if bs == nil {
|
||||
return status.Error(codes.InvalidArgument, "server does not exist when mark received")
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) er
|
|||
var bc *benchmarkClient
|
||||
defer func() {
|
||||
// Shut down benchmark client when stream ends.
|
||||
grpclog.Printf("shuting down benchmark client")
|
||||
grpclog.Infof("shuting down benchmark client")
|
||||
if bc != nil {
|
||||
bc.shutdown()
|
||||
}
|
||||
|
@ -151,9 +151,9 @@ func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) er
|
|||
var out *testpb.ClientStatus
|
||||
switch t := in.Argtype.(type) {
|
||||
case *testpb.ClientArgs_Setup:
|
||||
grpclog.Printf("client setup received:")
|
||||
grpclog.Infof("client setup received:")
|
||||
if bc != nil {
|
||||
grpclog.Printf("client setup received when client already exists, shuting down the existing client")
|
||||
grpclog.Infof("client setup received when client already exists, shuting down the existing client")
|
||||
bc.shutdown()
|
||||
}
|
||||
bc, err = startBenchmarkClient(t.Setup)
|
||||
|
@ -165,8 +165,8 @@ func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) er
|
|||
}
|
||||
|
||||
case *testpb.ClientArgs_Mark:
|
||||
grpclog.Printf("client mark received:")
|
||||
grpclog.Printf(" - %v", t)
|
||||
grpclog.Infof("client mark received:")
|
||||
grpclog.Infof(" - %v", t)
|
||||
if bc == nil {
|
||||
return status.Error(codes.InvalidArgument, "client does not exist when mark received")
|
||||
}
|
||||
|
@ -182,12 +182,12 @@ func (s *workerServer) RunClient(stream testpb.WorkerService_RunClientServer) er
|
|||
}
|
||||
|
||||
func (s *workerServer) CoreCount(ctx context.Context, in *testpb.CoreRequest) (*testpb.CoreResponse, error) {
|
||||
grpclog.Printf("core count: %v", runtime.NumCPU())
|
||||
grpclog.Infof("core count: %v", runtime.NumCPU())
|
||||
return &testpb.CoreResponse{Cores: int32(runtime.NumCPU())}, nil
|
||||
}
|
||||
|
||||
func (s *workerServer) QuitWorker(ctx context.Context, in *testpb.Void) (*testpb.Void, error) {
|
||||
grpclog.Printf("quitting worker")
|
||||
grpclog.Infof("quitting worker")
|
||||
s.stop <- true
|
||||
return &testpb.Void{}, nil
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ func main() {
|
|||
if err != nil {
|
||||
grpclog.Fatalf("failed to listen: %v", err)
|
||||
}
|
||||
grpclog.Printf("worker listening at port %v", *driverPort)
|
||||
grpclog.Infof("worker listening at port %v", *driverPort)
|
||||
|
||||
s := grpc.NewServer()
|
||||
stop := make(chan bool)
|
||||
|
@ -221,8 +221,8 @@ func main() {
|
|||
|
||||
if *pprofPort >= 0 {
|
||||
go func() {
|
||||
grpclog.Println("Starting pprof server on port " + strconv.Itoa(*pprofPort))
|
||||
grpclog.Println(http.ListenAndServe("localhost:"+strconv.Itoa(*pprofPort), nil))
|
||||
grpclog.Infoln("Starting pprof server on port " + strconv.Itoa(*pprofPort))
|
||||
grpclog.Infoln(http.ListenAndServe("localhost:"+strconv.Itoa(*pprofPort), nil))
|
||||
}()
|
||||
}
|
||||
|
||||
|
|
2
call.go
2
call.go
|
@ -67,7 +67,7 @@ func invoke(ctx context.Context, method string, req, reply interface{}, cc *Clie
|
|||
// newClientStream, SendMsg, RecvMsg.
|
||||
firstAttempt := true
|
||||
for {
|
||||
csInt, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...)
|
||||
csInt, err := cc.NewStream(ctx, unaryStreamDesc, method, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -168,7 +168,9 @@ func WithInitialConnWindowSize(s int32) DialOption {
|
|||
}
|
||||
}
|
||||
|
||||
// WithMaxMsgSize returns a DialOption which sets the maximum message size the client can receive. Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead.
|
||||
// WithMaxMsgSize returns a DialOption which sets the maximum message size the client can receive.
|
||||
//
|
||||
// Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead.
|
||||
func WithMaxMsgSize(s int) DialOption {
|
||||
return WithDefaultCallOptions(MaxCallRecvMsgSize(s))
|
||||
}
|
||||
|
@ -251,7 +253,8 @@ func withResolverBuilder(b resolver.Builder) DialOption {
|
|||
}
|
||||
|
||||
// WithServiceConfig returns a DialOption which has a channel to read the service configuration.
|
||||
// DEPRECATED: service config should be received through name resolver, as specified here.
|
||||
//
|
||||
// Deprecated: service config should be received through name resolver, as specified here.
|
||||
// https://github.com/grpc/grpc/blob/master/doc/service_config.md
|
||||
func WithServiceConfig(c <-chan ServiceConfig) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
|
@ -322,6 +325,7 @@ func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption {
|
|||
|
||||
// WithTimeout returns a DialOption that configures a timeout for dialing a ClientConn
|
||||
// initially. This is valid if and only if WithBlock() is present.
|
||||
//
|
||||
// Deprecated: use DialContext and context.WithTimeout instead.
|
||||
func WithTimeout(d time.Duration) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
|
|
|
@ -58,7 +58,7 @@ func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...CallOption
|
|||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
}
|
||||
stream, err := NewClientStream(ctx, desc, c.cc, "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, desc, "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -49,8 +49,6 @@ import (
|
|||
"google.golang.org/grpc/status"
|
||||
testpb "google.golang.org/grpc/test/grpc_testing"
|
||||
"google.golang.org/grpc/test/leakcheck"
|
||||
|
||||
_ "google.golang.org/grpc/grpclog/glogger"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -847,7 +845,7 @@ func TestGRPCLBStatsUnaryFailedToSend(t *testing.T) {
|
|||
t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, <nil>", testC, err)
|
||||
}
|
||||
for i := 0; i < countRPC-1; i++ {
|
||||
grpc.Invoke(context.Background(), failtosendURI, &testpb.Empty{}, nil, cc)
|
||||
cc.Invoke(context.Background(), failtosendURI, &testpb.Empty{}, nil)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -968,7 +966,7 @@ func TestGRPCLBStatsStreamingFailedToSend(t *testing.T) {
|
|||
}
|
||||
}
|
||||
for i := 0; i < countRPC-1; i++ {
|
||||
grpc.NewClientStream(context.Background(), &grpc.StreamDesc{}, cc, failtosendURI)
|
||||
cc.NewStream(context.Background(), &grpc.StreamDesc{}, failtosendURI)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -105,18 +105,21 @@ func Fatalln(args ...interface{}) {
|
|||
}
|
||||
|
||||
// Print prints to the logger. Arguments are handled in the manner of fmt.Print.
|
||||
//
|
||||
// Deprecated: use Info.
|
||||
func Print(args ...interface{}) {
|
||||
logger.Info(args...)
|
||||
}
|
||||
|
||||
// Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.
|
||||
//
|
||||
// Deprecated: use Infof.
|
||||
func Printf(format string, args ...interface{}) {
|
||||
logger.Infof(format, args...)
|
||||
}
|
||||
|
||||
// Println prints to the logger. Arguments are handled in the manner of fmt.Println.
|
||||
//
|
||||
// Deprecated: use Infoln.
|
||||
func Println(args ...interface{}) {
|
||||
logger.Infoln(args...)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package grpclog
|
||||
|
||||
// Logger mimics golang's standard Logger as an interface.
|
||||
//
|
||||
// Deprecated: use LoggerV2.
|
||||
type Logger interface {
|
||||
Fatal(args ...interface{})
|
||||
|
@ -31,6 +32,7 @@ type Logger interface {
|
|||
|
||||
// SetLogger sets the logger that is used in grpc. Call only from
|
||||
// init() functions.
|
||||
//
|
||||
// Deprecated: use SetLoggerV2.
|
||||
func SetLogger(l Logger) {
|
||||
logger = &loggerWrapper{Logger: l}
|
||||
|
|
|
@ -130,73 +130,73 @@ func main() {
|
|||
switch *testCase {
|
||||
case "empty_unary":
|
||||
interop.DoEmptyUnaryCall(tc)
|
||||
grpclog.Println("EmptyUnaryCall done")
|
||||
grpclog.Infoln("EmptyUnaryCall done")
|
||||
case "large_unary":
|
||||
interop.DoLargeUnaryCall(tc)
|
||||
grpclog.Println("LargeUnaryCall done")
|
||||
grpclog.Infoln("LargeUnaryCall done")
|
||||
case "client_streaming":
|
||||
interop.DoClientStreaming(tc)
|
||||
grpclog.Println("ClientStreaming done")
|
||||
grpclog.Infoln("ClientStreaming done")
|
||||
case "server_streaming":
|
||||
interop.DoServerStreaming(tc)
|
||||
grpclog.Println("ServerStreaming done")
|
||||
grpclog.Infoln("ServerStreaming done")
|
||||
case "ping_pong":
|
||||
interop.DoPingPong(tc)
|
||||
grpclog.Println("Pingpong done")
|
||||
grpclog.Infoln("Pingpong done")
|
||||
case "empty_stream":
|
||||
interop.DoEmptyStream(tc)
|
||||
grpclog.Println("Emptystream done")
|
||||
grpclog.Infoln("Emptystream done")
|
||||
case "timeout_on_sleeping_server":
|
||||
interop.DoTimeoutOnSleepingServer(tc)
|
||||
grpclog.Println("TimeoutOnSleepingServer done")
|
||||
grpclog.Infoln("TimeoutOnSleepingServer done")
|
||||
case "compute_engine_creds":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute compute_engine_creds test case.")
|
||||
}
|
||||
interop.DoComputeEngineCreds(tc, *defaultServiceAccount, *oauthScope)
|
||||
grpclog.Println("ComputeEngineCreds done")
|
||||
grpclog.Infoln("ComputeEngineCreds done")
|
||||
case "service_account_creds":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute service_account_creds test case.")
|
||||
}
|
||||
interop.DoServiceAccountCreds(tc, *serviceAccountKeyFile, *oauthScope)
|
||||
grpclog.Println("ServiceAccountCreds done")
|
||||
grpclog.Infoln("ServiceAccountCreds done")
|
||||
case "jwt_token_creds":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute jwt_token_creds test case.")
|
||||
}
|
||||
interop.DoJWTTokenCreds(tc, *serviceAccountKeyFile)
|
||||
grpclog.Println("JWTtokenCreds done")
|
||||
grpclog.Infoln("JWTtokenCreds done")
|
||||
case "per_rpc_creds":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute per_rpc_creds test case.")
|
||||
}
|
||||
interop.DoPerRPCCreds(tc, *serviceAccountKeyFile, *oauthScope)
|
||||
grpclog.Println("PerRPCCreds done")
|
||||
grpclog.Infoln("PerRPCCreds done")
|
||||
case "oauth2_auth_token":
|
||||
if !*useTLS {
|
||||
grpclog.Fatalf("TLS is not enabled. TLS is required to execute oauth2_auth_token test case.")
|
||||
}
|
||||
interop.DoOauth2TokenCreds(tc, *serviceAccountKeyFile, *oauthScope)
|
||||
grpclog.Println("Oauth2TokenCreds done")
|
||||
grpclog.Infoln("Oauth2TokenCreds done")
|
||||
case "cancel_after_begin":
|
||||
interop.DoCancelAfterBegin(tc)
|
||||
grpclog.Println("CancelAfterBegin done")
|
||||
grpclog.Infoln("CancelAfterBegin done")
|
||||
case "cancel_after_first_response":
|
||||
interop.DoCancelAfterFirstResponse(tc)
|
||||
grpclog.Println("CancelAfterFirstResponse done")
|
||||
grpclog.Infoln("CancelAfterFirstResponse done")
|
||||
case "status_code_and_message":
|
||||
interop.DoStatusCodeAndMessage(tc)
|
||||
grpclog.Println("StatusCodeAndMessage done")
|
||||
grpclog.Infoln("StatusCodeAndMessage done")
|
||||
case "custom_metadata":
|
||||
interop.DoCustomMetadata(tc)
|
||||
grpclog.Println("CustomMetadata done")
|
||||
grpclog.Infoln("CustomMetadata done")
|
||||
case "unimplemented_method":
|
||||
interop.DoUnimplementedMethod(conn)
|
||||
grpclog.Println("UnimplementedMethod done")
|
||||
grpclog.Infoln("UnimplementedMethod done")
|
||||
case "unimplemented_service":
|
||||
interop.DoUnimplementedService(testpb.NewUnimplementedServiceClient(conn))
|
||||
grpclog.Println("UnimplementedService done")
|
||||
grpclog.Infoln("UnimplementedService done")
|
||||
default:
|
||||
grpclog.Fatal("Unsupported test case: ", *testCase)
|
||||
}
|
||||
|
|
|
@ -137,22 +137,22 @@ func main() {
|
|||
switch *testCase {
|
||||
case "goaway":
|
||||
goaway(tc)
|
||||
grpclog.Println("goaway done")
|
||||
grpclog.Infoln("goaway done")
|
||||
case "rst_after_header":
|
||||
rstAfterHeader(tc)
|
||||
grpclog.Println("rst_after_header done")
|
||||
grpclog.Infoln("rst_after_header done")
|
||||
case "rst_during_data":
|
||||
rstDuringData(tc)
|
||||
grpclog.Println("rst_during_data done")
|
||||
grpclog.Infoln("rst_during_data done")
|
||||
case "rst_after_data":
|
||||
rstAfterData(tc)
|
||||
grpclog.Println("rst_after_data done")
|
||||
grpclog.Infoln("rst_after_data done")
|
||||
case "ping":
|
||||
ping(tc)
|
||||
grpclog.Println("ping done")
|
||||
grpclog.Infoln("ping done")
|
||||
case "max_streams":
|
||||
maxStreams(tc)
|
||||
grpclog.Println("max_streams done")
|
||||
grpclog.Infoln("max_streams done")
|
||||
default:
|
||||
grpclog.Fatal("Unsupported test case: ", *testCase)
|
||||
}
|
||||
|
|
|
@ -574,8 +574,8 @@ func DoUnimplementedService(tc testpb.UnimplementedServiceClient) {
|
|||
// DoUnimplementedMethod attempts to call an unimplemented method.
|
||||
func DoUnimplementedMethod(cc *grpc.ClientConn) {
|
||||
var req, reply proto.Message
|
||||
if err := grpc.Invoke(context.Background(), "/grpc.testing.TestService/UnimplementedCall", req, reply, cc); err == nil || status.Code(err) != codes.Unimplemented {
|
||||
grpclog.Fatalf("grpc.Invoke(_, _, _, _, _) = %v, want error code %s", err, codes.Unimplemented)
|
||||
if err := cc.Invoke(context.Background(), "/grpc.testing.TestService/UnimplementedCall", req, reply); err == nil || status.Code(err) != codes.Unimplemented {
|
||||
grpclog.Fatalf("ClientConn.Invoke(_, _, _, _, _) = %v, want error code %s", err, codes.Unimplemented)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,9 @@ import (
|
|||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// DecodeKeyValue returns k, v, nil. It is deprecated and should not be used.
|
||||
// DecodeKeyValue returns k, v, nil.
|
||||
//
|
||||
// Deprecated: use k and v directly instead.
|
||||
func DecodeKeyValue(k, v string) (string, string, error) {
|
||||
return k, v, nil
|
||||
}
|
||||
|
|
|
@ -226,7 +226,9 @@ func RPCDecompressor(dc Decompressor) ServerOption {
|
|||
}
|
||||
|
||||
// MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive.
|
||||
// If this is not set, gRPC uses the default limit. Deprecated: use MaxRecvMsgSize instead.
|
||||
// If this is not set, gRPC uses the default limit.
|
||||
//
|
||||
// Deprecated: use MaxRecvMsgSize instead.
|
||||
func MaxMsgSize(m int) ServerOption {
|
||||
return MaxRecvMsgSize(m)
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@ const maxInt = int(^uint(0) >> 1)
|
|||
|
||||
// MethodConfig defines the configuration recommended by the service providers for a
|
||||
// particular method.
|
||||
// DEPRECATED: Users should not use this struct. Service config should be received
|
||||
//
|
||||
// Deprecated: Users should not use this struct. Service config should be received
|
||||
// through name resolver, as specified here
|
||||
// https://github.com/grpc/grpc/blob/master/doc/service_config.md
|
||||
type MethodConfig struct {
|
||||
|
@ -59,7 +60,8 @@ type MethodConfig struct {
|
|||
|
||||
// ServiceConfig is provided by the service provider and contains parameters for how
|
||||
// clients that connect to the service should behave.
|
||||
// DEPRECATED: Users should not use this struct. Service config should be received
|
||||
//
|
||||
// Deprecated: Users should not use this struct. Service config should be received
|
||||
// through name resolver, as specified here
|
||||
// https://github.com/grpc/grpc/blob/master/doc/service_config.md
|
||||
type ServiceConfig struct {
|
||||
|
|
|
@ -249,23 +249,23 @@ func performRPCs(gauge *gauge, conn *grpc.ClientConn, selector *weightedRandomTe
|
|||
}
|
||||
|
||||
func logParameterInfo(addresses []string, tests []testCaseWithWeight) {
|
||||
grpclog.Printf("server_addresses: %s", *serverAddresses)
|
||||
grpclog.Printf("test_cases: %s", *testCases)
|
||||
grpclog.Printf("test_duration_secs: %d", *testDurationSecs)
|
||||
grpclog.Printf("num_channels_per_server: %d", *numChannelsPerServer)
|
||||
grpclog.Printf("num_stubs_per_channel: %d", *numStubsPerChannel)
|
||||
grpclog.Printf("metrics_port: %d", *metricsPort)
|
||||
grpclog.Printf("use_tls: %t", *useTLS)
|
||||
grpclog.Printf("use_test_ca: %t", *testCA)
|
||||
grpclog.Printf("server_host_override: %s", *tlsServerName)
|
||||
grpclog.Infof("server_addresses: %s", *serverAddresses)
|
||||
grpclog.Infof("test_cases: %s", *testCases)
|
||||
grpclog.Infof("test_duration_secs: %d", *testDurationSecs)
|
||||
grpclog.Infof("num_channels_per_server: %d", *numChannelsPerServer)
|
||||
grpclog.Infof("num_stubs_per_channel: %d", *numStubsPerChannel)
|
||||
grpclog.Infof("metrics_port: %d", *metricsPort)
|
||||
grpclog.Infof("use_tls: %t", *useTLS)
|
||||
grpclog.Infof("use_test_ca: %t", *testCA)
|
||||
grpclog.Infof("server_host_override: %s", *tlsServerName)
|
||||
|
||||
grpclog.Println("addresses:")
|
||||
grpclog.Infoln("addresses:")
|
||||
for i, addr := range addresses {
|
||||
grpclog.Printf("%d. %s\n", i+1, addr)
|
||||
grpclog.Infof("%d. %s\n", i+1, addr)
|
||||
}
|
||||
grpclog.Println("tests:")
|
||||
grpclog.Infoln("tests:")
|
||||
for i, test := range tests {
|
||||
grpclog.Printf("%d. %v\n", i+1, test)
|
||||
grpclog.Infof("%d. %v\n", i+1, test)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,6 +332,6 @@ func main() {
|
|||
close(stop)
|
||||
}
|
||||
wg.Wait()
|
||||
grpclog.Printf(" ===== ALL DONE ===== ")
|
||||
grpclog.Infof(" ===== ALL DONE ===== ")
|
||||
|
||||
}
|
||||
|
|
|
@ -55,14 +55,14 @@ func printMetrics(client metricspb.MetricsServiceClient, totalOnly bool) {
|
|||
}
|
||||
v := gaugeResponse.GetLongValue()
|
||||
if !totalOnly {
|
||||
grpclog.Printf("%s: %d", gaugeResponse.Name, v)
|
||||
grpclog.Infof("%s: %d", gaugeResponse.Name, v)
|
||||
}
|
||||
overallQPS += v
|
||||
}
|
||||
if rpcStatus != io.EOF {
|
||||
grpclog.Fatalf("failed to finish server streaming: %v", rpcStatus)
|
||||
}
|
||||
grpclog.Printf("overall qps: %d", overallQPS)
|
||||
grpclog.Infof("overall qps: %d", overallQPS)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче