mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
Remove unused metric for SQS apply duration
This was added as part of a wider performance investigation [1]. I
checked with Leo, who made the change, and while the other metrics
are still be useful, there's no reason to keep this one.
[1]: 6e32ca5996 (diff-76936416943346b5f691dac57a64acebc6a1227293820d1d9af4791087c9fb9eR23)
This commit is contained in:
@@ -4,7 +4,6 @@ from celery import Celery, Task
|
|||||||
from celery.signals import worker_process_shutdown
|
from celery.signals import worker_process_shutdown
|
||||||
from flask import g, request
|
from flask import g, request
|
||||||
from flask.ctx import has_app_context, has_request_context
|
from flask.ctx import has_app_context, has_request_context
|
||||||
from gds_metrics.metrics import Histogram
|
|
||||||
|
|
||||||
|
|
||||||
@worker_process_shutdown.connect
|
@worker_process_shutdown.connect
|
||||||
@@ -20,12 +19,6 @@ def log_on_worker_shutdown(sender, signal, pid, exitcode, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def make_task(app):
|
def make_task(app):
|
||||||
SQS_APPLY_ASYNC_DURATION_SECONDS = Histogram(
|
|
||||||
'sqs_apply_async_duration_seconds',
|
|
||||||
'Time taken to put task on queue',
|
|
||||||
['task_name']
|
|
||||||
)
|
|
||||||
|
|
||||||
class NotifyTask(Task):
|
class NotifyTask(Task):
|
||||||
abstract = True
|
abstract = True
|
||||||
start = None
|
start = None
|
||||||
@@ -60,8 +53,7 @@ def make_task(app):
|
|||||||
elif has_app_context() and 'request_id' in g:
|
elif has_app_context() and 'request_id' in g:
|
||||||
kwargs['request_id'] = g.request_id
|
kwargs['request_id'] = g.request_id
|
||||||
|
|
||||||
with SQS_APPLY_ASYNC_DURATION_SECONDS.labels(self.name).time():
|
return super().apply_async(args, kwargs, task_id, producer, link, link_error, **options)
|
||||||
return super().apply_async(args, kwargs, task_id, producer, link, link_error, **options)
|
|
||||||
|
|
||||||
return NotifyTask
|
return NotifyTask
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user