Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add QueryMetricsExtension to graphql view #572

Merged
merged 2 commits into from
May 23, 2024
Merged

add QueryMetricsExtension to graphql view #572

merged 2 commits into from
May 23, 2024

Conversation

nora-codecov
Copy link
Contributor

Purpose/Motivation

Gives insight into our GraphQL use

Links to relevant tickets

codecov/engineering-team#1238

What does this PR do?

Adds 2 counters and 1 timer to our GQL endpoint, we should be able to see what queries are being used the most and if any are mad slow

Notes to Reviewer

The hardest part for me was trying to anticipate all the possible formats for our queries, to be able to parse and log them correctly in set_type_and_name. I have them listed in test_query_metrics_extension_set_type_and_name. If anyone knows of any other patterns we use, let me know and I'll build them in.

@nora-codecov nora-codecov requested a review from a team as a code owner May 17, 2024 22:01

extension.set_type_and_name(query=sample_wildcard)
assert extension.operation_type == "unknown_type"
assert extension.operation_name == "unknown_name"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does anyone know any additional query formats/patterns? LMK

@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.42%. Comparing base (43827db) to head (5524218).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
+ Coverage   91.40%   91.42%   +0.02%     
==========================================
  Files         604      604              
  Lines       16052    16102      +50     
==========================================
+ Hits        14672    14722      +50     
  Misses       1380     1380              
Flag Coverage Δ
unit 91.42% <100.00%> (+0.02%) ⬆️
unit-latest-uploader 91.42% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov-public-qa bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.42%. Comparing base (43827db) to head (5524218).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
+ Coverage   91.40%   91.42%   +0.02%     
==========================================
  Files         604      604              
  Lines       16052    16102      +50     
==========================================
+ Hits        14672    14722      +50     
  Misses       1380     1380              
Flag Coverage Δ
unit 91.42% <100.00%> (+0.02%) ⬆️
unit-latest-uploader 91.42% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
graphql_api/views.py 98.01% <100.00%> (+0.98%) ⬆️

Impacted file tree graph

Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.87%. Comparing base (43827db) to head (5524218).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #572     +/-   ##
=======================================
+ Coverage   95.86   95.87   +0.01     
=======================================
  Files        782     782             
  Lines      17370   17420     +50     
=======================================
+ Hits       16651   16701     +50     
  Misses       719     719             
Flag Coverage Δ
unit 91.42% <100.00%> (+0.02%) ⬆️
unit-latest-uploader 91.42% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

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

Lgtm! I think you need someone with API permissions to approve this though

@nora-codecov nora-codecov force-pushed the nora/1238 branch 3 times, most recently from 48d6ff6 to 4b0a637 Compare May 22, 2024 00:40
Copy link
Contributor

@matt-codecov matt-codecov left a comment

Choose a reason for hiding this comment

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

great work! great comments and making sure cases are covered

@nora-codecov nora-codecov added this pull request to the merge queue May 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 23, 2024
@nora-codecov nora-codecov added this pull request to the merge queue May 23, 2024
Merged via the queue into main with commit 11f094a May 23, 2024
21 of 22 checks passed
@nora-codecov nora-codecov deleted the nora/1238 branch May 23, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants