mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 15:48:24 -04:00
track message costs
This commit is contained in:
@@ -266,7 +266,7 @@ def process_delivery_receipts(self):
|
|||||||
|
|
||||||
cloudwatch = AwsCloudwatchClient()
|
cloudwatch = AwsCloudwatchClient()
|
||||||
cloudwatch.init_app(current_app)
|
cloudwatch.init_app(current_app)
|
||||||
start_time = aware_utcnow() - timedelta(minutes=30)
|
start_time = aware_utcnow() - timedelta(minutes=3)
|
||||||
end_time = aware_utcnow()
|
end_time = aware_utcnow()
|
||||||
delivered_receipts, failed_receipts = cloudwatch.check_delivery_receipts(
|
delivered_receipts, failed_receipts = cloudwatch.check_delivery_receipts(
|
||||||
start_time, end_time
|
start_time, end_time
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from flask import current_app
|
|||||||
|
|
||||||
from app.clients import AWS_CLIENT_CONFIG, Client
|
from app.clients import AWS_CLIENT_CONFIG, Client
|
||||||
from app.cloudfoundry_config import cloud_config
|
from app.cloudfoundry_config import cloud_config
|
||||||
from app.utils import hilite
|
|
||||||
|
|
||||||
|
|
||||||
class AwsCloudwatchClient(Client):
|
class AwsCloudwatchClient(Client):
|
||||||
@@ -113,7 +112,6 @@ class AwsCloudwatchClient(Client):
|
|||||||
message_cost = 0.0
|
message_cost = 0.0
|
||||||
else:
|
else:
|
||||||
message_cost = float(message_cost)
|
message_cost = float(message_cost)
|
||||||
current_app.logger.info(hilite(f"EVENT {event} message_cost = {message_cost}"))
|
|
||||||
|
|
||||||
my_timestamp = self._aws_value_or_default(event, "notification", "timestamp")
|
my_timestamp = self._aws_value_or_default(event, "notification", "timestamp")
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user