Skip to content

Commit e72d3e2

Browse files
authored
Update index-metrics.md
1 parent 5c2d88c commit e72d3e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

articles/cosmos-db/nosql/index-metrics.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ You can enable indexing metrics for a query by setting the `PopulateIndexMetrics
7171

7272
CosmosPagedFlux<JsonNode> items = container.queryItems(querySpec, options, JsonNode.class);
7373

74-
items.byPage().toIterable().forEach(itemsResponse -> {
75-
logger.info("Query item diagnostics through iterableByPage : {}",
76-
itemsResponse.getCosmosDiagnostics());
74+
items.byPage(100).flatMap(itemsResponse -> {
75+
logger.info("diagnostics: {}",itemsResponse.getCosmosDiagnostics());
7776
for (JsonNode item : itemsResponse.getResults()) {
7877
logger.info("Item: {}", item.toString());
7978
}
80-
});
79+
executeCountQueryPrintSingleResultNumber.incrementAndGet();
80+
return Flux.just(itemsResponse);
81+
}).blockLast();
8182
```
8283
---
8384

0 commit comments

Comments
 (0)