2020import com .google .api .gax .tracing .ApiTracerFactory ;
2121import com .google .api .gax .tracing .SpanName ;
2222import com .google .common .collect .ImmutableMap ;
23- import io .grpc .Status ;
2423import io .opencensus .stats .AggregationData ;
2524import io .opencensus .stats .View ;
2625import io .opencensus .stats .ViewData ;
@@ -54,7 +53,7 @@ public void setup() {
5453
5554 @ Test
5655 public void testStreamingOperation () throws InterruptedException {
57- StatsRecorderWrapper tracer =
56+ StatsRecorderWrapper recorderWrapper =
5857 new StatsRecorderWrapper (
5958 ApiTracerFactory .OperationType .ServerStreaming ,
6059 SpanName .of ("Bigtable" , "ReadRows" ),
@@ -73,16 +72,16 @@ public void testStreamingOperation() throws InterruptedException {
7372 long throttlingLatency = 50 ;
7473 long firstResponseLatency = 90 ;
7574
76- tracer .putOperationLatencies (operationLatency );
77- tracer .putRetryCount (attemptCount );
78- tracer .putAttemptLatencies (attemptLatency );
79- tracer .putApplicationLatencies (applicationLatency );
80- tracer .putGfeLatencies (serverLatency );
81- tracer .putGfeMissingHeaders (connectivityErrorCount );
82- tracer .putFirstResponseLatencies (firstResponseLatency );
83- tracer .putBatchRequestThrottled (throttlingLatency );
75+ recorderWrapper .putOperationLatencies (operationLatency );
76+ recorderWrapper .putRetryCount (attemptCount );
77+ recorderWrapper .putAttemptLatencies (attemptLatency );
78+ recorderWrapper .putApplicationLatencies (applicationLatency );
79+ recorderWrapper .putGfeLatencies (serverLatency );
80+ recorderWrapper .putGfeMissingHeaders (connectivityErrorCount );
81+ recorderWrapper .putFirstResponseLatencies (firstResponseLatency );
82+ recorderWrapper .putBatchRequestThrottled (throttlingLatency );
8483
85- tracer .record ("OK" , TABLE_ID , ZONE , CLUSTER );
84+ recorderWrapper .record ("OK" , TABLE_ID , ZONE , CLUSTER );
8685
8786 Thread .sleep (100 );
8887
@@ -244,7 +243,7 @@ public void testStreamingOperation() throws InterruptedException {
244243
245244 @ Test
246245 public void testUnaryOperations () throws InterruptedException {
247- StatsRecorderWrapper tracer =
246+ StatsRecorderWrapper recorderWrapper =
248247 new StatsRecorderWrapper (
249248 ApiTracerFactory .OperationType .ServerStreaming ,
250249 SpanName .of ("Bigtable" , "MutateRow" ),
@@ -263,16 +262,16 @@ public void testUnaryOperations() throws InterruptedException {
263262 long throttlingLatency = 50 ;
264263 long firstResponseLatency = 90 ;
265264
266- tracer .putOperationLatencies (operationLatency );
267- tracer .putRetryCount (attemptCount );
268- tracer .putAttemptLatencies (attemptLatency );
269- tracer .putApplicationLatencies (applicationLatency );
270- tracer .putGfeLatencies (serverLatency );
271- tracer .putGfeMissingHeaders (connectivityErrorCount );
272- tracer .putFirstResponseLatencies (firstResponseLatency );
273- tracer .putBatchRequestThrottled (throttlingLatency );
265+ recorderWrapper .putOperationLatencies (operationLatency );
266+ recorderWrapper .putRetryCount (attemptCount );
267+ recorderWrapper .putAttemptLatencies (attemptLatency );
268+ recorderWrapper .putApplicationLatencies (applicationLatency );
269+ recorderWrapper .putGfeLatencies (serverLatency );
270+ recorderWrapper .putGfeMissingHeaders (connectivityErrorCount );
271+ recorderWrapper .putFirstResponseLatencies (firstResponseLatency );
272+ recorderWrapper .putBatchRequestThrottled (throttlingLatency );
274273
275- tracer .record (Status . UNAVAILABLE . toString () , TABLE_ID , ZONE , CLUSTER );
274+ recorderWrapper .record (" UNAVAILABLE" , TABLE_ID , ZONE , CLUSTER );
276275
277276 Thread .sleep (100 );
278277
@@ -283,7 +282,7 @@ public void testUnaryOperations() throws InterruptedException {
283282 BuiltinMeasureConstants .METHOD ,
284283 "Bigtable.MutateRow" ,
285284 BuiltinMeasureConstants .STATUS ,
286- Status . UNAVAILABLE . toString () ,
285+ " UNAVAILABLE" ,
287286 BuiltinMeasureConstants .TABLE ,
288287 TABLE_ID ,
289288 BuiltinMeasureConstants .ZONE ,
@@ -305,7 +304,7 @@ public void testUnaryOperations() throws InterruptedException {
305304 BuiltinMeasureConstants .METHOD ,
306305 "Bigtable.MutateRow" ,
307306 BuiltinMeasureConstants .STATUS ,
308- Status . UNAVAILABLE . toString () ,
307+ " UNAVAILABLE" ,
309308 BuiltinMeasureConstants .TABLE ,
310309 TABLE_ID ,
311310 BuiltinMeasureConstants .ZONE ,
@@ -327,7 +326,7 @@ public void testUnaryOperations() throws InterruptedException {
327326 BuiltinMeasureConstants .METHOD ,
328327 "Bigtable.MutateRow" ,
329328 BuiltinMeasureConstants .STATUS ,
330- Status . UNAVAILABLE . toString () ,
329+ " UNAVAILABLE" ,
331330 BuiltinMeasureConstants .TABLE ,
332331 TABLE_ID ,
333332 BuiltinMeasureConstants .ZONE ,
@@ -347,7 +346,7 @@ public void testUnaryOperations() throws InterruptedException {
347346 BuiltinMeasureConstants .METHOD ,
348347 "Bigtable.MutateRow" ,
349348 BuiltinMeasureConstants .STATUS ,
350- Status . UNAVAILABLE . toString () ,
349+ " UNAVAILABLE" ,
351350 BuiltinMeasureConstants .CLIENT_NAME ,
352351 "bigtable-java" ,
353352 BuiltinMeasureConstants .STREAMING ,
@@ -369,7 +368,7 @@ public void testUnaryOperations() throws InterruptedException {
369368 BuiltinMeasureConstants .METHOD ,
370369 "Bigtable.MutateRow" ,
371370 BuiltinMeasureConstants .STATUS ,
372- Status . UNAVAILABLE . toString () ,
371+ " UNAVAILABLE" ,
373372 BuiltinMeasureConstants .TABLE ,
374373 TABLE_ID ,
375374 BuiltinMeasureConstants .ZONE ,
@@ -391,7 +390,7 @@ public void testUnaryOperations() throws InterruptedException {
391390 BuiltinMeasureConstants .METHOD ,
392391 "Bigtable.MutateRow" ,
393392 BuiltinMeasureConstants .STATUS ,
394- Status . UNAVAILABLE . toString () ,
393+ " UNAVAILABLE" ,
395394 BuiltinMeasureConstants .CLIENT_NAME ,
396395 "bigtable-java" ,
397396 BuiltinMeasureConstants .TABLE ,
@@ -430,7 +429,7 @@ public void testUnaryOperations() throws InterruptedException {
430429 BuiltinMeasureConstants .CLUSTER ,
431430 CLUSTER ,
432431 BuiltinMeasureConstants .STATUS ,
433- Status . UNAVAILABLE . toString () ,
432+ " UNAVAILABLE" ,
434433 BuiltinMeasureConstants .CLIENT_NAME ,
435434 "bigtable-java" ),
436435 PROJECT_ID ,
0 commit comments