Merge pull request #8345 from edx/adam/time-imports
time how long imports take in datadog
This commit is contained in:
@@ -21,6 +21,7 @@ from django.utils.translation import ugettext as _
|
|||||||
from django.views.decorators.http import require_http_methods, require_GET
|
from django.views.decorators.http import require_http_methods, require_GET
|
||||||
|
|
||||||
from django_future.csrf import ensure_csrf_cookie
|
from django_future.csrf import ensure_csrf_cookie
|
||||||
|
import dogstats_wrapper as dog_stats_api
|
||||||
from edxmako.shortcuts import render_to_response
|
from edxmako.shortcuts import render_to_response
|
||||||
from xmodule.contentstore.django import contentstore
|
from xmodule.contentstore.django import contentstore
|
||||||
from xmodule.exceptions import SerializationError
|
from xmodule.exceptions import SerializationError
|
||||||
@@ -260,13 +261,17 @@ def _import_handler(request, courselike_key, root_name, successful_url, context_
|
|||||||
log.info("Course import %s: Extracted file verified", courselike_key)
|
log.info("Course import %s: Extracted file verified", courselike_key)
|
||||||
_save_request_status(request, courselike_string, 3)
|
_save_request_status(request, courselike_string, 3)
|
||||||
|
|
||||||
courselike_items = import_func(
|
with dog_stats_api.timer(
|
||||||
modulestore(), request.user.id,
|
'courselike_import.time',
|
||||||
settings.GITHUB_REPO_ROOT, [dirpath],
|
tags=[u"courselike:{}".format(courselike_key)]
|
||||||
load_error_modules=False,
|
):
|
||||||
static_content_store=contentstore(),
|
courselike_items = import_func(
|
||||||
target_id=courselike_key
|
modulestore(), request.user.id,
|
||||||
)
|
settings.GITHUB_REPO_ROOT, [dirpath],
|
||||||
|
load_error_modules=False,
|
||||||
|
static_content_store=contentstore(),
|
||||||
|
target_id=courselike_key
|
||||||
|
)
|
||||||
|
|
||||||
new_location = courselike_items[0].location
|
new_location = courselike_items[0].location
|
||||||
logging.debug('new course at %s', new_location)
|
logging.debug('new course at %s', new_location)
|
||||||
|
|||||||
Reference in New Issue
Block a user