Commit 278daaa8 by Will Daly

Add datadog timing metrics to AI worker tasks

parent 5a37fa2e
...@@ -25,6 +25,7 @@ RESCHEDULE_TASK_QUEUE = getattr(settings, 'LOW_PRIORITY_QUEUE', None) ...@@ -25,6 +25,7 @@ RESCHEDULE_TASK_QUEUE = getattr(settings, 'LOW_PRIORITY_QUEUE', None)
@task(max_retries=MAX_RETRIES) # pylint: disable=E1102 @task(max_retries=MAX_RETRIES) # pylint: disable=E1102
@dog_stats_api.timed('openassessment.assessment.ai.grade_essay.time')
def grade_essay(workflow_uuid): def grade_essay(workflow_uuid):
""" """
Asynchronous task to grade an essay using a text classifier Asynchronous task to grade an essay using a text classifier
...@@ -100,6 +101,7 @@ def grade_essay(workflow_uuid): ...@@ -100,6 +101,7 @@ def grade_essay(workflow_uuid):
@task(queue=RESCHEDULE_TASK_QUEUE, max_retries=MAX_RETRIES) # pylint: disable=E1102 @task(queue=RESCHEDULE_TASK_QUEUE, max_retries=MAX_RETRIES) # pylint: disable=E1102
@dog_stats_api.timed('openassessment.assessment.ai.reschedule_grading_tasks.time')
def reschedule_grading_tasks(course_id, item_id): def reschedule_grading_tasks(course_id, item_id):
""" """
Reschedules all incomplete grading workflows with the specified parameters. Reschedules all incomplete grading workflows with the specified parameters.
......
...@@ -5,7 +5,6 @@ import datetime ...@@ -5,7 +5,6 @@ import datetime
from collections import defaultdict from collections import defaultdict
from celery import task from celery import task
from celery.utils.log import get_task_logger from celery.utils.log import get_task_logger
from celery.exceptions import InvalidTaskError, NotConfigured, NotRegistered, QueueNotFound
from dogapi import dog_stats_api from dogapi import dog_stats_api
from django.conf import settings from django.conf import settings
from django.db import DatabaseError from django.db import DatabaseError
...@@ -39,6 +38,7 @@ class InvalidExample(Exception): ...@@ -39,6 +38,7 @@ class InvalidExample(Exception):
@task(queue=TRAINING_TASK_QUEUE, max_retries=MAX_RETRIES) # pylint: disable=E1102 @task(queue=TRAINING_TASK_QUEUE, max_retries=MAX_RETRIES) # pylint: disable=E1102
@dog_stats_api.timed('openassessment.assessment.ai.train_classifiers.time')
def train_classifiers(workflow_uuid): def train_classifiers(workflow_uuid):
""" """
Asynchronous task to train classifiers for AI grading. Asynchronous task to train classifiers for AI grading.
...@@ -150,6 +150,7 @@ def train_classifiers(workflow_uuid): ...@@ -150,6 +150,7 @@ def train_classifiers(workflow_uuid):
@task(queue=RESCHEDULE_TASK_QUEUE, max_retries=MAX_RETRIES) #pylint: disable=E1102 @task(queue=RESCHEDULE_TASK_QUEUE, max_retries=MAX_RETRIES) #pylint: disable=E1102
@dog_stats_api.timed('openassessment.assessment.ai.reschedule_training_tasks.time')
def reschedule_training_tasks(course_id, item_id): def reschedule_training_tasks(course_id, item_id):
""" """
Reschedules all incomplete training tasks Reschedules all incomplete training tasks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment