-
Notifications
You must be signed in to change notification settings - Fork 403
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
feat: Add api usage metrics for different periods #3870
feat: Add api usage metrics for different periods #3870
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3870 +/- ##
==========================================
+ Coverage 96.28% 96.40% +0.12%
==========================================
Files 1143 1145 +2
Lines 36992 37198 +206
==========================================
+ Hits 35618 35862 +244
+ Misses 1374 1336 -38 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two nitpicks, one naming request I trust @zachaysan to address, otherwise LGTM.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
This provides the ability to get API usage data for different billing periods. The supported new periods are the current billing period (i.e., the first day of the billing period till now), the previous billing period, and a 90-day rolling period to the present.
Part of these changes involved with a refactoring of how code is called to influxdb. The former code incorrectly attributed
date_range
as if it weredate_start
with an inverse modifier. With the former code any callers that had set adate_stop
to anything other thannow()
the resultant range would be smaller than the interface contract implied. These issues have been addressed and subsequent calling methods have been updated.There was also an issue that cropped up with Pydantic and Freeze Gun, which has been temporarily solved with the addition of an auto-use function in
conftest.py
.How did you test this code?
Tested manually against production influxdb to verify results then also added 3 tests to ensure calling signatures to related influxdb functions.