Merge pull request #2373 from alphagov/slow-provider-threshold

move slow sms provider threshold from 10% to 20%
This commit is contained in:
Leo Hemsted
2019-02-25 15:22:42 +00:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ def switch_current_sms_provider_on_slow_delivery():
return
slow_delivery_notifications = is_delivery_slow_for_provider(
provider=current_provider.identifier,
threshold=0.1,
threshold=0.2,
created_at=datetime.utcnow() - timedelta(minutes=10),
delivery_time=timedelta(minutes=4),
)

View File

@@ -494,8 +494,8 @@ def is_delivery_slow_for_provider(
slow_notifications = counts.get(True, 0)
if total_notifications:
current_app.logger.info("Slow delivery notifications count: {} out of {}. Ratio {}".format(
slow_notifications, total_notifications, slow_notifications / total_notifications
current_app.logger.info("Slow delivery notifications count for provider {}: {} out of {}. Ratio {}".format(
provider, slow_notifications, total_notifications, slow_notifications / total_notifications
))
return slow_notifications / total_notifications >= threshold
else: