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

feat(uptime): Skip results from shadow regions in the result consumer #85711

Open
wants to merge 1 commit into
base: danf/uptime-assign-shadow-regions
Choose a base branch
from

Conversation

wedamija
Copy link
Member

When we receive a result, we check the subscriptions regions and see if they're in shadow mode. If so, drop the result and log a stat.

When we receive a result, we check the subscriptions regions and see if they're in shadow mode. If so, drop the result and log a stat.
@wedamija wedamija requested a review from a team as a code owner February 22, 2025 00:22
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 22, 2025
Comment on lines +267 to +276
@cache_func_for_models(
[(UptimeSubscriptionRegion, lambda region: (region.uptime_subscription_id,))],
recalculate=False,
)
def get_regions_for_uptime_subscription(
uptime_subscription_id: int,
) -> list[UptimeSubscriptionRegion]:
return list(
UptimeSubscriptionRegion.objects.filter(uptime_subscription_id=uptime_subscription_id)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to add caches like this for other things we fetch, hoping it might improve performance here a little.

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                          Coverage Diff                          @@
##           danf/uptime-assign-shadow-regions   #85711      +/-   ##
=====================================================================
- Coverage                              87.87%   87.86%   -0.02%     
=====================================================================
  Files                                   9677     9672       -5     
  Lines                                 548104   547495     -609     
  Branches                               21384    21384              
=====================================================================
- Hits                                  481648   481030     -618     
- Misses                                 66147    66156       +9     
  Partials                                 309      309              

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants