Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7147876
D2394.id8435.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2394.id8435.diff
View Options
diff --git a/swh/scheduler/celery_backend/listener.py b/swh/scheduler/celery_backend/listener.py
--- a/swh/scheduler/celery_backend/listener.py
+++ b/swh/scheduler/celery_backend/listener.py
@@ -16,6 +16,8 @@
import celery
from celery.events import EventReceiver
+from swh.core.statsd import statsd
+
class ReliableEventReceiver(EventReceiver):
def __init__(self, channel, handlers=None, routing_key='#',
@@ -46,7 +48,10 @@
"""Process the received event by dispatching it to the appropriate
handler."""
handler = self.handlers.get(type) or self.handlers.get('*')
- handler and handler(event, message)
+ if handler:
+ handler(event, message)
+ statsd.increment('swh_listener_handled_event_total',
+ tags={'event_type': type})
ACTION_SEND_DELAY = datetime.timedelta(seconds=1.0)
diff --git a/swh/scheduler/celery_backend/runner.py b/swh/scheduler/celery_backend/runner.py
--- a/swh/scheduler/celery_backend/runner.py
+++ b/swh/scheduler/celery_backend/runner.py
@@ -7,6 +7,7 @@
import logging
from kombu.utils.uuid import uuid
+from swh.core.statsd import statsd
from swh.scheduler import get_scheduler, compute_nb_tasks_from
@@ -73,7 +74,10 @@
pending_tasks.extend(grabbed_tasks)
logger.info('Grabbed %s tasks %s',
len(grabbed_tasks), task_type_name)
-
+ statsd.increment(
+ 'swh_runner_scheduled_task_total',
+ len(grabbed_tasks),
+ tags={'task_type': task_type})
if not pending_tasks:
return all_backend_tasks
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 2:33 AM (20 h, 3 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3228044
Attached To
D2394: celery: add 2 statsd probes for the runner and listener
Event Timeline
Log In to Comment