def process_response(self, request, response): request.profiler_view = _get_current_view() _set_current_view(None) if True: _tac('view') _tic('mid2') return response
def process_response(self, request, response): if True: _tac('mid2') _tac('req') client = get_client() if client is not None: try: client.insert({'code_part': 'Middlewares Down', 'type': 'code'}, {'time': _get_time('mid1'), 'count': 1}) except StandardError: pass try: client.insert({'code_part': 'Middlewares Up', 'type': 'code'}, {'time': _get_time('mid2'), 'count': 1}) except StandardError: pass try: client.insert({'request_path': request.path, 'type': 'url'}, {'time': _get_time('req'), 'count': 1}) except StandardError: pass try: client.insert({'code_part': request.profiler_view, 'type': 'code'}, {'time': _get_time('view'), 'count': 1}) except StandardError: pass return response
def process_view(self, request, view_func, view_args, view_kwargs): if inspect.ismethod(view_func): view_name = view_func.im_class.__module__+ '.' + view_func.im_class.__name__ + view_func.__name__ else: view_name = view_func.__module__ + '.' + view_func.__name__ _set_current_view(view_name) _tac('mid1') _tic('view')
def process_view(self, request, view_func, view_args, view_kwargs): if inspect.ismethod(view_func): view_name = view_func.im_class.__module__ + '.' + view_func.im_class.__name__ + view_func.__name__ else: view_name = view_func.__module__ + '.' + view_func.__name__ _set_current_view(view_name) _tac('mid1') _tic('view')
def process_response(self, request, response): if True: _tac('mid2') _tac('req') client = get_client() if client is not None: try: client.insert( { 'code_part': 'Middlewares Down', 'type': 'code' }, { 'time': _get_time('mid1'), 'count': 1 }) except StandardError: pass try: client.insert( { 'code_part': 'Middlewares Up', 'type': 'code' }, { 'time': _get_time('mid2'), 'count': 1 }) except StandardError: pass try: client.insert({ 'request_path': request.path, 'type': 'url' }, { 'time': _get_time('req'), 'count': 1 }) except StandardError: pass try: client.insert( { 'code_part': request.profiler_view, 'type': 'code' }, { 'time': _get_time('view'), 'count': 1 }) except StandardError: pass return response