@@ -36,7 +36,12 @@ type RPCStats interface {
36
36
IsClient () bool
37
37
}
38
38
39
- // Begin contains stats when an RPC attempt begins.
39
+ // Begin contains stats for the start of an RPC attempt.
40
+ //
41
+ // - Server-side: Triggered after `InHeader`, as headers are processed
42
+ // before the RPC lifecycle begins.
43
+ // - Client-side: The first stats event recorded.
44
+ //
40
45
// FailFast is only valid if this Begin is from client side.
41
46
type Begin struct {
42
47
// Client is true if this Begin is from client side.
@@ -69,7 +74,7 @@ func (*PickerUpdated) IsClient() bool { return true }
69
74
70
75
func (* PickerUpdated ) isRPCStats () {}
71
76
72
- // InPayload contains the information for an incoming payload.
77
+ // InPayload contains stats about an incoming payload.
73
78
type InPayload struct {
74
79
// Client is true if this InPayload is from client side.
75
80
Client bool
@@ -98,7 +103,9 @@ func (s *InPayload) IsClient() bool { return s.Client }
98
103
99
104
func (s * InPayload ) isRPCStats () {}
100
105
101
- // InHeader contains stats when a header is received.
106
+ // InHeader contains stats about header reception.
107
+ //
108
+ // - Server-side: The first stats event after the RPC request is received.
102
109
type InHeader struct {
103
110
// Client is true if this InHeader is from client side.
104
111
Client bool
@@ -123,7 +130,7 @@ func (s *InHeader) IsClient() bool { return s.Client }
123
130
124
131
func (s * InHeader ) isRPCStats () {}
125
132
126
- // InTrailer contains stats when a trailer is received .
133
+ // InTrailer contains stats about trailer reception .
127
134
type InTrailer struct {
128
135
// Client is true if this InTrailer is from client side.
129
136
Client bool
@@ -139,7 +146,7 @@ func (s *InTrailer) IsClient() bool { return s.Client }
139
146
140
147
func (s * InTrailer ) isRPCStats () {}
141
148
142
- // OutPayload contains the information for an outgoing payload.
149
+ // OutPayload contains stats about an outgoing payload.
143
150
type OutPayload struct {
144
151
// Client is true if this OutPayload is from client side.
145
152
Client bool
@@ -166,7 +173,10 @@ func (s *OutPayload) IsClient() bool { return s.Client }
166
173
167
174
func (s * OutPayload ) isRPCStats () {}
168
175
169
- // OutHeader contains stats when a header is sent.
176
+ // OutHeader contains stats about header transmission.
177
+ //
178
+ // - Client-side: Only occurs after 'Begin', as headers are always the first
179
+ // thing sent on a stream.
170
180
type OutHeader struct {
171
181
// Client is true if this OutHeader is from client side.
172
182
Client bool
@@ -189,14 +199,15 @@ func (s *OutHeader) IsClient() bool { return s.Client }
189
199
190
200
func (s * OutHeader ) isRPCStats () {}
191
201
192
- // OutTrailer contains stats when a trailer is sent .
202
+ // OutTrailer contains stats about trailer transmission .
193
203
type OutTrailer struct {
194
204
// Client is true if this OutTrailer is from client side.
195
205
Client bool
196
206
// WireLength is the wire length of trailer.
197
207
//
198
- // Deprecated: This field is never set. The length is not known when this message is
199
- // emitted because the trailer fields are compressed with hpack after that.
208
+ // Deprecated: This field is never set. The length is not known when this
209
+ // message is emitted because the trailer fields are compressed with hpack
210
+ // after that.
200
211
WireLength int
201
212
// Trailer contains the trailer metadata sent to the client. This
202
213
// field is only valid if this OutTrailer is from the server side.
@@ -208,7 +219,7 @@ func (s *OutTrailer) IsClient() bool { return s.Client }
208
219
209
220
func (s * OutTrailer ) isRPCStats () {}
210
221
211
- // End contains stats when an RPC ends .
222
+ // End contains stats about RPC completion .
212
223
type End struct {
213
224
// Client is true if this End is from client side.
214
225
Client bool
@@ -238,7 +249,7 @@ type ConnStats interface {
238
249
IsClient () bool
239
250
}
240
251
241
- // ConnBegin contains the stats of a connection when it is established .
252
+ // ConnBegin contains stats about connection establishment .
242
253
type ConnBegin struct {
243
254
// Client is true if this ConnBegin is from client side.
244
255
Client bool
@@ -249,7 +260,7 @@ func (s *ConnBegin) IsClient() bool { return s.Client }
249
260
250
261
func (s * ConnBegin ) isConnStats () {}
251
262
252
- // ConnEnd contains the stats of a connection when it ends .
263
+ // ConnEnd contains stats about connection termination .
253
264
type ConnEnd struct {
254
265
// Client is true if this ConnEnd is from client side.
255
266
Client bool
0 commit comments