src/dirbs/importer/abstract_importer.py
def _time_component_perf(self, key, fn, *fnargs, **fnkwargs):
        """Helper function to time the performance of a function."""
        component_key = '{0}import_time.components.{1}'.format(self._metrics_import_root, key)
        perf_metadata_path = '{{performance_timing,{0}_start}}'.format(key)
        metadata.add_time_metadata(self._metadata_conn, 'dirbs-import', self.import_id, perf_metadata_path)
        with CodeProfiler() as cp:
            rv = fn(*fnargs, **fnkwargs)
        self._statsd.gauge(component_key, cp.duration)
        perf_metadata_path = '{{performance_timing, {0}_end}}'.format(key)
        metadata.add_time_metadata(self._metadata_conn, 'dirbs-import', self.import_id, perf_metadata_path)
        return rv
Helper function to time the performance of a function.
Helper function to time the performance of a function.
Helper function to time the performance of a function .
def _time_component_perf(self, key, fn, *fnargs, **fnkwargs):
        component_key = '{0}import_time.components.{1}'.format(self._metrics_import_root, key)
        perf_metadata_path = '{{performance_timing,{0}_start}}'.format(key)
        metadata.add_time_metadata(self._metadata_conn, 'dirbs-import', self.import_id, perf_metadata_path)
        with CodeProfiler() as cp:
            rv = fn(*fnargs, **fnkwargs)
        self._statsd.gauge(component_key, cp.duration)
        perf_metadata_path = '{{performance_timing, {0}_end}}'.format(key)
        metadata.add_time_metadata(self._metadata_conn, 'dirbs-import', self.import_id, perf_metadata_path)
        return rv
def _time_component_perf ( self , key , fn , * fnargs , ** fnkwargs ) : component_key = '{0}import_time.components.{1}' . format ( self . _metrics_import_root , key ) perf_metadata_path = '{{performance_timing,{0}_start}}' . format ( key ) metadata . add_time_metadata ( self . _metadata_conn , 'dirbs-import' , self . import_id , perf_metadata_path ) with CodeProfiler ( ) as cp : rv = fn ( * fnargs , ** fnkwargs ) self . _statsd . gauge ( component_key , cp . duration ) perf_metadata_path = '{{performance_timing, {0}_end}}' . format ( key ) metadata . add_time_metadata ( self . _metadata_conn , 'dirbs-import' , self . import_id , perf_metadata_path ) return rv
Helper function to time the performance of a function.
Helper function to time the performance of a function .
"""Helper function to time the performance of a function."""
self
key
fn