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

Refactor SQL query time calculation to use Django aggregation #720

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

beltagymohamed
Copy link
Contributor

@beltagymohamed beltagymohamed commented Jul 13, 2024

This will fix a "FIXME" in the tests, and will make the code faster by utilizing db aggregation instead of python sum

@beltagymohamed beltagymohamed changed the title Use db aggregation of python sum for total time Refactor SQL query time calculation to use Django aggregation Jul 13, 2024
@webknjaz webknjaz requested a review from albertyw July 16, 2024 16:04
silk/models.py Outdated
@@ -124,16 +125,13 @@ def profile_table(self):

@property
def time_spent_on_sql_queries(self):
""""
Calculate the total time spent in milli seconds on SQL queries using Django aggregates.
Copy link
Member

Choose a reason for hiding this comment

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

nit - "milliseconds" instead of "milli seconds"

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.82%. Comparing base (1cb4623) to head (96390db).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #720      +/-   ##
==========================================
+ Coverage   86.76%   86.82%   +0.05%     
==========================================
  Files          52       52              
  Lines        2115     2117       +2     
==========================================
+ Hits         1835     1838       +3     
+ Misses        280      279       -1     

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

@albertyw albertyw merged commit 7e35c19 into jazzband:master Aug 16, 2024
90 checks passed
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.

2 participants