Disable Redis for Staging added statsd for post methods

- Disable Redis as there is a current connection limit of 256 which
 could slow down the request if they are all used
 - Added statd to methods in the post to help spot any bottlenecks
This commit is contained in:
Richard Chapman
2017-12-01 15:30:18 +00:00
parent 64c67dea5e
commit 5f25d3162a
5 changed files with 18 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
from app.statsd_decorators import statsd
def create_post_sms_response_from_notification(notification, content, from_number, url_root, scheduled_for):
noti = __create_notification_response(notification, url_root, scheduled_for)
@@ -8,6 +10,7 @@ def create_post_sms_response_from_notification(notification, content, from_numbe
return noti
@statsd(namespace="performance-testing")
def create_post_email_response_from_notification(notification, content, subject, email_from, url_root, scheduled_for):
noti = __create_notification_response(notification, url_root, scheduled_for)
noti['content'] = {

View File

@@ -34,6 +34,7 @@ from app.notifications.validators import (
check_service_sms_sender_id
)
from app.schema_validation import validate
from app.statsd_decorators import statsd
from app.v2.errors import BadRequestError
from app.v2.notifications import v2_notification_blueprint
from app.v2.notifications.notification_schemas import (
@@ -118,6 +119,7 @@ def post_notification(notification_type):
return jsonify(resp), 201
@statsd(namespace="performance-testing")
def process_sms_or_email_notification(*, form, notification_type, api_key, template, service, reply_to_text=None):
form_send_to = form['email_address'] if notification_type == EMAIL_TYPE else form['phone_number']
@@ -160,6 +162,7 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ
return notification
@statsd(namespace="performance-testing")
def process_letter_notification(*, letter_data, api_key, template):
if api_key.key_type == KEY_TYPE_TEAM:
raise BadRequestError(message='Cannot send letters with a team api key', status_code=403)
@@ -187,6 +190,7 @@ def process_letter_notification(*, letter_data, api_key, template):
return notification
@statsd(namespace="performance-testing")
def get_reply_to_text(notification_type, form):
reply_to = None
if notification_type == EMAIL_TYPE: