38
38
/**
39
39
* Utilities for Census monitoring and tracing.
40
40
*
41
- * @since 1.24
42
41
* @author Hailong Wen
42
+ * @since 1.24
43
43
*/
44
44
public class OpenCensusUtils {
45
45
@@ -52,8 +52,8 @@ public class OpenCensusUtils {
52
52
"Sent." + HttpRequest .class .getName () + ".execute" ;
53
53
54
54
/**
55
- * OpenCensus tracing component.
56
- * When no OpenCensus implementation is provided, it will return a no-op tracer.
55
+ * OpenCensus tracing component. When no OpenCensus implementation is provided, it will return a
56
+ * no-op tracer.
57
57
*/
58
58
private static Tracer tracer = Tracing .getTracer ();
59
59
@@ -189,8 +189,8 @@ public static EndSpanOptions getEndSpanOptions(@Nullable Integer statusCode) {
189
189
}
190
190
191
191
/**
192
- * Records a new message event which contains the size of the request content.
193
- * Note that the size represents the message size in application layer, i.e., content-length.
192
+ * Records a new message event which contains the size of the request content. Note that the size
193
+ * represents the message size in application layer, i.e., content-length.
194
194
*
195
195
* @param span The {@code span} in which the send event occurs.
196
196
* @param id The id for the message, It is unique within an {@link HttpRequest}.
@@ -201,8 +201,8 @@ public static void recordSentMessageEvent(Span span, long id, long size) {
201
201
}
202
202
203
203
/**
204
- * Records a new message event which contains the size of the response content.
205
- * Note that the size represents the message size in application layer, i.e., content-length.
204
+ * Records a new message event which contains the size of the response content. Note that the size
205
+ * represents the message size in application layer, i.e., content-length.
206
206
*
207
207
* @param span The {@code span} in which the receive event occurs.
208
208
* @param id The id for the message. It is unique within an {@link HttpRequest}.
@@ -213,9 +213,8 @@ public static void recordReceivedMessageEvent(Span span, long id, long size) {
213
213
}
214
214
215
215
/**
216
- * Records a message event of a certain {@link NetowrkEvent.Type}.
217
- * This method is package protected since {@link NetworkEvent} might be deprecated in future
218
- * releases.
216
+ * Records a message event of a certain {@link NetowrkEvent.Type}. This method is package
217
+ * protected since {@link NetworkEvent} might be deprecated in future releases.
219
218
*
220
219
* @param span The {@code span} in which the event occurs.
221
220
* @param id The id for the message.
@@ -225,7 +224,9 @@ public static void recordReceivedMessageEvent(Span span, long id, long size) {
225
224
@ VisibleForTesting
226
225
static void recordMessageEvent (Span span , long id , long size , Type eventType ) {
227
226
Preconditions .checkArgument (span != null , "span should not be null." );
228
- if (size < 0 ) size = 0 ;
227
+ if (size < 0 ) {
228
+ size = 0 ;
229
+ }
229
230
NetworkEvent event = NetworkEvent
230
231
.builder (eventType , id )
231
232
.setUncompressedMessageSize (size )
0 commit comments