コード例 #1
0
ファイル: views.py プロジェクト: stackhpc/horizon
 def decorator(func):
     if setting_utils.get_dict_config('OPENSTACK_PROFILER', 'enabled'):
         return profiler.trace(name,
                               info=None,
                               hide_args=False,
                               allow_multiple_trace=True)(func)
     return func
コード例 #2
0
    def test_duplicate_trace_disallow(self, mock_start, mock_stop):
        @profiler.trace("test")
        def trace_me():
            pass

        self.assertRaises(
            ValueError, profiler.trace("test-again",
                                       allow_multiple_trace=False), trace_me)
コード例 #3
0
ファイル: views.py プロジェクト: cybera/horizon-11.0.4
 def decorator(func):
     if getattr(settings, 'OPENSTACK_PROFILER', {}).get('enabled', False):
         return profiler.trace(name,
                               info=None,
                               hide_args=False,
                               allow_multiple_trace=True)(func)
     else:
         return func
コード例 #4
0
ファイル: test_profiler.py プロジェクト: openstack/osprofiler
    def test_duplicate_trace_disallow(self, mock_start, mock_stop):

        @profiler.trace("test")
        def trace_me():
            pass

        self.assertRaises(
            ValueError,
            profiler.trace("test-again", allow_multiple_trace=False),
            trace_me)
コード例 #5
0
ファイル: api.py プロジェクト: my-master-yang/xiong
 def trace(function):
     func_name = function.__module__ + '.' + function.__name__
     decorator = profiler.trace(func_name)
     return decorator(function)
コード例 #6
0
ファイル: views.py プロジェクト: CCI-MOC/horizon
 def decorator(func):
     if getattr(settings, 'OPENSTACK_PROFILER', {}).get('enabled', False):
         return profiler.trace(name, info=None, hide_args=False,
                               allow_multiple_trace=True)(func)
     else:
         return func
コード例 #7
0
ファイル: api.py プロジェクト: noironetworks/horizon
 def trace(function):
     func_name = function.__module__ + '.' + function.__name__
     decorator = profiler.trace(func_name)
     return decorator(function)