Skip to content

Query: Adds GetIndexMetrics LINQ extension method#5313

Merged
microsoft-github-policy-service[bot] merged 15 commits intomasterfrom
users/leminh/ResponseINdexMetrics
Aug 7, 2025
Merged

Query: Adds GetIndexMetrics LINQ extension method#5313
microsoft-github-policy-service[bot] merged 15 commits intomasterfrom
users/leminh/ResponseINdexMetrics

Conversation

@leminh98
Copy link
Copy Markdown
Contributor

Pull Request Template

Description

This PR adds a new extension method GetindexMetrics that can be used on a Response<T> object to get the index metrics information. Normally, the index metrics is only accessible via FeedResponse.IndexMetrics. This provide an additional way to obtain this information when using LINQ async extension method like CountAsync/SumAsync/AvgAsync, whose return type is a Response<TSource>.

As part of this fix, this PR also address these async method not populating IndexUtilizationText field on the Response object as well.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

@leminh98 leminh98 changed the title Query: Adds GetindexMetrics LINQ extension method Query: Adds GetIndexMetrics LINQ extension method Jul 24, 2025
@leminh98 leminh98 added the auto-merge Enables automation to merge PRs label Jul 24, 2025
@microsoft-github-policy-service microsoft-github-policy-service Bot enabled auto-merge (squash) July 24, 2025 05:29
@leminh98 leminh98 requested a review from a team as a code owner July 24, 2025 05:34
@adityasa
Copy link
Copy Markdown
Contributor

adityasa commented Jul 25, 2025

    internal T ExecuteScalar()

Also update this? #Resolved


Refers to: Microsoft.Azure.Cosmos/src/Linq/CosmosLinqQuery.cs:242 in 9f52d3a. [](commit_id = 9f52d3a, deletion_comment = False)

@leminh98
Copy link
Copy Markdown
Contributor Author

leminh98 commented Jul 30, 2025

    internal T ExecuteScalar()

not really even sure why the headers are being set here. The execute scalre returns T, so it's not like it's possible to access Headers related information - so I don't think we need to update this


In reply to: 3120612275


Refers to: Microsoft.Azure.Cosmos/src/Linq/CosmosLinqQuery.cs:242 in 9f52d3a. [](commit_id = 9f52d3a, deletion_comment = False)

Comment thread Microsoft.Azure.Cosmos/src/Linq/CosmosLinqQuery.cs
adityasa
adityasa previously approved these changes Aug 6, 2025
Copy link
Copy Markdown
Contributor

@adityasa adityasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

kirankumarkolli
kirankumarkolli previously approved these changes Aug 7, 2025
@leminh98 leminh98 dismissed stale reviews from kirankumarkolli and adityasa via 6c6652a August 7, 2025 19:02
Copy link
Copy Markdown
Contributor

@adityasa adityasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@microsoft-github-policy-service microsoft-github-policy-service Bot merged commit d57cf6f into master Aug 7, 2025
27 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot deleted the users/leminh/ResponseINdexMetrics branch August 7, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants