| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2088a39 commit bba4183
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,9 +79,9 @@ class BuiltinMetricsTracer extends BigtableTracer { | |||
| 79 | 79 | private final AtomicInteger requestLeft = new AtomicInteger(0); | |
| 80 | 80 | ||
| 81 | 81 | // Monitored resource labels | |
| 82 | - private String tableId = "unspecified"; | ||
| 82 | + private String tableId = "<unspecified>"; | ||
| 83 | 83 | private String zone = "global"; | |
| 84 | - private String cluster = "unspecified"; | ||
| 84 | + private String cluster = "<unspecified>"; | ||
| 85 | 85 | ||
| 86 | 86 | private final AtomicLong totalClientBlockingTime = new AtomicLong(0); | |
| 87 | 87 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,8 +24,10 @@ | |||
| 24 | 24 | import com.google.api.gax.rpc.StatusCode.Code; | |
| 25 | 25 | import com.google.bigtable.v2.AuthorizedViewName; | |
| 26 | 26 | import com.google.bigtable.v2.CheckAndMutateRowRequest; | |
| 27 | + import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; | ||
| 27 | 28 | import com.google.bigtable.v2.MutateRowRequest; | |
| 28 | 29 | import com.google.bigtable.v2.MutateRowsRequest; | |
| 30 | + import com.google.bigtable.v2.ReadChangeStreamRequest; | ||
| 29 | 31 | import com.google.bigtable.v2.ReadModifyWriteRowRequest; | |
| 30 | 32 | import com.google.bigtable.v2.ReadRowsRequest; | |
| 31 | 33 | import com.google.bigtable.v2.ResponseParams; | |
@@ -127,14 +129,18 @@ static String extractTableId(Object request) { | |||
| 127 | 129 | } else if (request instanceof ReadModifyWriteRowRequest) { | |
| 128 | 130 | tableName = ((ReadModifyWriteRowRequest) request).getTableName(); | |
| 129 | 131 | authorizedViewName = ((ReadModifyWriteRowRequest) request).getAuthorizedViewName(); | |
| 132 | + } else if (request instanceof GenerateInitialChangeStreamPartitionsRequest) { | ||
| 133 | + tableName = ((GenerateInitialChangeStreamPartitionsRequest) request).getTableName(); | ||
| 134 | + } else if (request instanceof ReadChangeStreamRequest) { | ||
| 135 | + tableName = ((ReadChangeStreamRequest) request).getTableName(); | ||
| 130 | 136 | } | |
| 131 | - if (tableName == null && authorizedViewName == null) return "undefined"; | ||
| 132 | - if (tableName.isEmpty() && authorizedViewName.isEmpty()) return "undefined"; | ||
| 133 | - if (!tableName.isEmpty()) { | ||
| 137 | + if (tableName != null && !tableName.isEmpty()) { | ||
| 134 | 138 | return TableName.parse(tableName).getTable(); | |
| 135 | - } else { | ||
| 139 | + } | ||
| 140 | + if (authorizedViewName != null && !authorizedViewName.isEmpty()) { | ||
| 136 | 141 | return AuthorizedViewName.parse(authorizedViewName).getTable(); | |
| 137 | 142 | } | |
| 143 | + return "<unspecified>"; | ||
| 138 | 144 | } | |
| 139 | 145 | ||
| 140 | 146 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,9 +167,9 @@ public void testFailure() { | |||
| 167 | 167 | ||
| 168 | 168 | assertThat(pointData) | |
| 169 | 169 | .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) | |
| 170 | - .contains("unspecified"); | ||
| 170 | + .contains("<unspecified>"); | ||
| 171 | 171 | assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); | |
| 172 | - assertThat(clusterAttributes).contains("unspecified"); | ||
| 172 | + assertThat(clusterAttributes).contains("<unspecified>"); | ||
| 173 | 173 | assertThat(zoneAttributes).contains("global"); | |
| 174 | 174 | } | |
| 175 | 175 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -182,7 +182,7 @@ public void testFailure() throws Exception { | |||
| 182 | 182 | ||
| 183 | 183 | assertThat(pointData) | |
| 184 | 184 | .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) | |
| 185 | - .contains("unspecified"); | ||
| 185 | + .contains("<unspecified>"); | ||
| 186 | 186 | assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); | |
| 187 | 187 | List<String> clusterAttributes = | |
| 188 | 188 | pointData.stream() | |
@@ -193,7 +193,7 @@ public void testFailure() throws Exception { | |||
| 193 | 193 | .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.ZONE_ID_KEY)) | |
| 194 | 194 | .collect(Collectors.toList()); | |
| 195 | 195 | ||
| 196 | - assertThat(clusterAttributes).contains("unspecified"); | ||
| 196 | + assertThat(clusterAttributes).contains("<unspecified>"); | ||
| 197 | 197 | assertThat(zoneAttributes).contains("global"); | |
| 198 | 198 | } | |
| 199 | 199 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -395,7 +395,7 @@ public void testGfeMetrics() { | |||
| 395 | 395 | .put(STATUS_KEY, "UNAVAILABLE") | |
| 396 | 396 | .put(TABLE_ID_KEY, TABLE) | |
| 397 | 397 | .put(ZONE_ID_KEY, "global") | |
| 398 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 398 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 399 | 399 | .put(METHOD_KEY, "Bigtable.ReadRows") | |
| 400 | 400 | .put(CLIENT_NAME_KEY, CLIENT_NAME) | |
| 401 | 401 | .build(); | |
@@ -549,7 +549,7 @@ public void testMutateRowAttemptsTagValues() { | |||
| 549 | 549 | .put(STATUS_KEY, "UNAVAILABLE") | |
| 550 | 550 | .put(TABLE_ID_KEY, TABLE) | |
| 551 | 551 | .put(ZONE_ID_KEY, "global") | |
| 552 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 552 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 553 | 553 | .put(METHOD_KEY, "Bigtable.MutateRow") | |
| 554 | 554 | .put(CLIENT_NAME_KEY, CLIENT_NAME) | |
| 555 | 555 | .put(STREAMING_KEY, false) | |
@@ -619,7 +619,7 @@ public void testMutateRowsRpcError() { | |||
| 619 | 619 | .put(STATUS_KEY, "NOT_FOUND") | |
| 620 | 620 | .put(TABLE_ID_KEY, BAD_TABLE_ID) | |
| 621 | 621 | .put(ZONE_ID_KEY, "global") | |
| 622 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 622 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 623 | 623 | .put(METHOD_KEY, "Bigtable.MutateRows") | |
| 624 | 624 | .put(CLIENT_NAME_KEY, CLIENT_NAME) | |
| 625 | 625 | .put(STREAMING_KEY, false) | |
@@ -640,7 +640,7 @@ public void testReadRowsAttemptsTagValues() { | |||
| 640 | 640 | .put(STATUS_KEY, "UNAVAILABLE") | |
| 641 | 641 | .put(TABLE_ID_KEY, TABLE) | |
| 642 | 642 | .put(ZONE_ID_KEY, "global") | |
| 643 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 643 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 644 | 644 | .put(METHOD_KEY, "Bigtable.ReadRows") | |
| 645 | 645 | .put(CLIENT_NAME_KEY, CLIENT_NAME) | |
| 646 | 646 | .put(STREAMING_KEY, true) | |
@@ -751,7 +751,7 @@ public void testPermanentFailure() { | |||
| 751 | 751 | .toBuilder() | |
| 752 | 752 | .put(STATUS_KEY, "NOT_FOUND") | |
| 753 | 753 | .put(TABLE_ID_KEY, BAD_TABLE_ID) | |
| 754 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 754 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 755 | 755 | .put(ZONE_ID_KEY, "global") | |
| 756 | 756 | .put(STREAMING_KEY, true) | |
| 757 | 757 | .put(METHOD_KEY, "Bigtable.ReadRows") | |
@@ -776,7 +776,7 @@ public void testRemainingDeadline() { | |||
| 776 | 776 | .put(TABLE_ID_KEY, TABLE) | |
| 777 | 777 | .put(METHOD_KEY, "Bigtable.ReadRows") | |
| 778 | 778 | .put(ZONE_ID_KEY, "global") | |
| 779 | - .put(CLUSTER_ID_KEY, "unspecified") | ||
| 779 | + .put(CLUSTER_ID_KEY, "<unspecified>") | ||
| 780 | 780 | .put(STREAMING_KEY, true) | |
| 781 | 781 | .put(CLIENT_NAME_KEY, CLIENT_NAME) | |
| 782 | 782 | .build(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments