Skip to content

Add Index metrics to python sdk#33034

Merged
bambriz merged 4 commits intoAzure:mainfrom
bambriz:index-metrics
Nov 10, 2023
Merged

Add Index metrics to python sdk#33034
bambriz merged 4 commits intoAzure:mainfrom
bambriz:index-metrics

Conversation

@bambriz
Copy link
Copy Markdown
Member

@bambriz bambriz commented Nov 8, 2023

This PR adds Index Metrics to Python SDK.

You can capture index metrics by passing in the populate_index_metrics keyword in query items.
query_items = container.query_items(query="Select * from c", populate_index_metrics=True)

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

This PR adds Index Metrics to Python SDK
@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-cosmos

Copy link
Copy Markdown
Member

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

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

small suggestions but great stuff nonetheless, thank you Bryan! 👍

let's make sure to include the CHANGELOG like you said as well

Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py Outdated
Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py Outdated
Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/container.py Outdated
@simorenoh
Copy link
Copy Markdown
Member

also side random question, but from what I saw we send "x-ms-cosmos-populateindexmetrics" and the service returns "x-ms-cosmos-index-utilization" - is that right? there's no other additional headers that get returned on this right?

@bambriz
Copy link
Copy Markdown
Member Author

bambriz commented Nov 8, 2023

also side random question, but from what I saw we send "x-ms-cosmos-populateindexmetrics" and the service returns "x-ms-cosmos-index-utilization" - is that right? there's no other additional headers that get returned on this right?

That is correct.

@bambriz
Copy link
Copy Markdown
Member Author

bambriz commented Nov 8, 2023

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Removed the param reference so that we can use it as a keyword
@bambriz
Copy link
Copy Markdown
Member Author

bambriz commented Nov 8, 2023

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Member

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

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

LGTM thanks Bryan!

Copy link
Copy Markdown
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @bambriz !

Comment thread sdk/cosmos/azure-cosmos/CHANGELOG.md Outdated
Co-authored-by: Kushagra Thapar <kushuthapar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants