Merge "Log time of the apply_func only if it took more than 0.1 second"

This commit is contained in:
Zuul
2020-08-24 14:55:49 +00:00
committed by Gerrit Code Review

View File

@@ -18,9 +18,15 @@ NOTE: This module shall not be used by external projects. It will be moved
import collections
import inspect
from oslo_log import log as logging
from oslo_utils import timeutils
from neutron_lib.utils import helpers
LOG = logging.getLogger(__name__)
# This dictionary will store methods for extending API resources.
# Extensions can add their own methods by invoking register_funcs().
_resource_extend_functions = {
@@ -70,7 +76,7 @@ def get_funcs(resource):
return _resource_extend_functions.get(resource, [])
@helpers.timecost
@timeutils.time_it(LOG, min_duration=0.1)
def apply_funcs(resource_type, response, db_object):
"""Appy registered functions for the said resource type.