Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 760fb02

Browse files
committed
add print statements to cloudwatch metric task
1 parent 5d9d13e commit 760fb02

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

awscdk/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
# CloudWatch Container Insights
3939
stack.node.apply_aspect(core.Tag("StackName", full_app_name))
4040

41+
print(len(stack.node.children))
42+
4143
app.synth()

backend/apps/core/management/commands/put_celery_cloudwatch_metrics.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def active_and_reserved_tasks_by_queue_name(self, queue_name):
1919
and values are lists of active tasks for the worker
2020
2121
"""
22+
print("inspecting celery queue")
2223
i = celery_app.control.inspect()
2324

2425
active = i.active()
@@ -45,6 +46,7 @@ def active_and_reserved_tasks_by_queue_name(self, queue_name):
4546
]
4647
)
4748

49+
print("connecting to redis")
4850
r = redis.Redis(
4951
host=settings.REDIS_SERVICE_HOST,
5052
port=6379,
@@ -58,13 +60,16 @@ def active_and_reserved_tasks_by_queue_name(self, queue_name):
5860
return active_count + reserved_count + queue_length
5961

6062
def publish_queue_metrics(self, queue_names):
63+
print("gathering queue data")
6164
metric_data = {
6265
queue_name: self.active_and_reserved_tasks_by_queue_name(
6366
queue_name
6467
)
6568
for queue_name in queue_names
6669
}
70+
print("sending cloudwatch data")
6771
if not settings.DEBUG:
72+
print("connecting aws api")
6873
client = boto3.client('cloudwatch')
6974
client.put_metric_data(
7075
Namespace=os.environ.get("FULL_APP_NAME", "FULL_APP_NAME"),
@@ -75,5 +80,5 @@ def publish_queue_metrics(self, queue_names):
7580
)
7681

7782
def handle(self, *args, **options):
78-
83+
print("starting task")
7984
self.publish_queue_metrics(["default"])

0 commit comments

Comments
 (0)