From 54acba773f5441dcb049bf2a2da74131e822cc7d Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Wed, 10 May 2017 16:57:54 -0700 Subject: [PATCH] change comment for tagRPC and stats fields --- stats/handlers.go | 5 +++-- stats/stats.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stats/handlers.go b/stats/handlers.go index 184ebf6554a6..5fdce2f5bb7d 100644 --- a/stats/handlers.go +++ b/stats/handlers.go @@ -48,18 +48,19 @@ type ConnTagInfo struct { } // RPCTagInfo defines the relevant information needed by RPC context tagger. -// FailFast is only valid on client side, it's always false on server side. type RPCTagInfo struct { // FullMethodName is the RPC method in the format of /package.service/method. FullMethodName string // FailFast indicates if this RPC is failfast. + // This field is only valid on client side, it's always false on server side. FailFast bool } // Handler defines the interface for the related stats handling (e.g., RPCs, connections). type Handler interface { // TagRPC can attach some information to the given context. - // The returned context is used in the rest lifetime of the RPC. + // The context used for the rest lifetime of the RPC will be derived from + // the returned context. TagRPC(context.Context, *RPCTagInfo) context.Context // HandleRPC processes the RPC stats. HandleRPC(context.Context, RPCStats) diff --git a/stats/stats.go b/stats/stats.go index 75bdd8165a99..6c406c7bad0e 100644 --- a/stats/stats.go +++ b/stats/stats.go @@ -86,13 +86,13 @@ func (s *InPayload) IsClient() bool { return s.Client } func (s *InPayload) isRPCStats() {} // InHeader contains stats when a header is received. -// FullMethod, addresses and Compression are only valid if Client is false. type InHeader struct { // Client is true if this InHeader is from client side. Client bool // WireLength is the wire length of header. WireLength int + // The following fields are valid only if Client is false. // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // RemoteAddr is the remote address of the corresponding connection. @@ -143,13 +143,13 @@ func (s *OutPayload) IsClient() bool { return s.Client } func (s *OutPayload) isRPCStats() {} // OutHeader contains stats when a header is sent. -// FullMethod, addresses and Compression are only valid if Client is true. type OutHeader struct { // Client is true if this OutHeader is from client side. Client bool // WireLength is the wire length of header. WireLength int + // The following fields are valid only if Client is true. // FullMethod is the full RPC method string, i.e., /package.service/method. FullMethod string // RemoteAddr is the remote address of the corresponding connection.