|
11 | 11 | import com.azure.cosmos.implementation.FeedResponseDiagnostics;
|
12 | 12 | import com.azure.cosmos.implementation.GlobalEndpointManager;
|
13 | 13 | import com.azure.cosmos.implementation.HttpConstants;
|
14 |
| -import com.azure.cosmos.implementation.IndexUtilizationInfo; |
15 | 14 | import com.azure.cosmos.implementation.InternalObjectNode;
|
16 | 15 | import com.azure.cosmos.implementation.LifeCycleUtils;
|
17 | 16 | import com.azure.cosmos.implementation.OperationCancelledException;
|
@@ -535,11 +534,11 @@ public void queryMetricsWithIndexMetrics() {
|
535 | 534 | while (iterator.hasNext()) {
|
536 | 535 | FeedResponse<InternalObjectNode> feedResponse = iterator.next();
|
537 | 536 | queryDiagnostics = feedResponse.getCosmosDiagnostics().toString();
|
538 |
| - logger.info("This is query diagnostics {}", queryDiagnostics); |
539 |
| - if (feedResponse.getResponseHeaders().containsKey(HttpConstants.HttpHeaders.INDEX_UTILIZATION)) { |
540 |
| - assertThat(feedResponse.getResponseHeaders().get(HttpConstants.HttpHeaders.INDEX_UTILIZATION)).isNotNull(); |
541 |
| - assertThat(createFromJSONString(Utils.decodeBase64String(feedResponse.getResponseHeaders().get(HttpConstants.HttpHeaders.INDEX_UTILIZATION))).getUtilizedSingleIndexes()).isNotNull(); |
542 |
| - } |
| 537 | + assertThat(queryDiagnostics).contains("\"indexUtilizationInfo\""); |
| 538 | + assertThat(queryDiagnostics).contains("\"UtilizedSingleIndexes\""); |
| 539 | + assertThat(queryDiagnostics).contains("\"PotentialSingleIndexes\""); |
| 540 | + assertThat(queryDiagnostics).contains("\"UtilizedCompositeIndexes\""); |
| 541 | + assertThat(queryDiagnostics).contains("\"PotentialCompositeIndexes\""); |
543 | 542 | }
|
544 | 543 | }
|
545 | 544 | }
|
@@ -1556,17 +1555,6 @@ private HttpClient httpClient(boolean fakeProxy) {
|
1556 | 1555 | return HttpClient.createFixed(httpClientConfig);
|
1557 | 1556 | }
|
1558 | 1557 |
|
1559 |
| - private IndexUtilizationInfo createFromJSONString(String jsonString) { |
1560 |
| - ObjectMapper indexUtilizationInfoObjectMapper = new ObjectMapper(); |
1561 |
| - IndexUtilizationInfo indexUtilizationInfo = null; |
1562 |
| - try { |
1563 |
| - indexUtilizationInfo = indexUtilizationInfoObjectMapper.readValue(jsonString, IndexUtilizationInfo.class); |
1564 |
| - } catch (JsonProcessingException e) { |
1565 |
| - logger.error("Json not correctly formed ", e); |
1566 |
| - } |
1567 |
| - return indexUtilizationInfo; |
1568 |
| - } |
1569 |
| - |
1570 | 1558 | private void validateRegionContacted(CosmosDiagnostics cosmosDiagnostics, CosmosAsyncClient cosmosAsyncClient) throws Exception {
|
1571 | 1559 | RxDocumentClientImpl rxDocumentClient =
|
1572 | 1560 | (RxDocumentClientImpl) ReflectionUtils.getAsyncDocumentClient(cosmosAsyncClient);
|
|
0 commit comments