Пример #1
0
def wsgi_application_wrapper(module, object_path, *args):
    """
    :param module:
    :param object_path:
    :return:
    """
    wrap_object(module, object_path, wsgi_wrapper_inline, *args)
Пример #2
0
def trace_serve_controller(module, object_path):
    """all application errors in web2py will raised in this function.
    :param module:
    :param object_path:
    :return:
    """
    wrap_object(module, object_path, uncaught_exception_wrapper)
Пример #3
0
def detect_channel(module):
    """
    :return:
    """
    # 基于selection connection libevent connect tornado connection 的生产者目前使用场景大部分为非web过程内
    # 需要单独处理才能支持,咱不考虑
    wrap_object(module, "Channel.basic_publish", mq_produce_trace_wrapper)
    wrap_function_wrapper(module.Channel, "basic_consume", mq_consume_wrapper)

    # 下面的方法都是采用即时读写的方式跟mq通信,故可以直接采集之性能
    wrap_function_trace(module.Channel, "basic_get", name='basic_get')
    wrap_function_trace(module.Channel, "basic_nack", name='basic_nack')
    wrap_function_trace(module.Channel, "exchange_bind", name='exchange_bind')
    wrap_function_trace(module.Channel,
                        "exchange_declare",
                        name='exchange_declare')
    wrap_function_trace(module.Channel,
                        "exchange_delete",
                        name='exchange_delete')
    wrap_function_trace(module.Channel, "queue_bind", name='queue_bind')
    wrap_function_trace(module.Channel, "queue_declare", name='queue_declare')
    wrap_function_trace(module.Channel, "queue_delete", name='queue_delete')

    # 其他常规用户可能执行的回调
    # 为了减少性能开销,不捕获基于CallbackManager.add所有的回调函数
    wrap_function_wrapper(module, "Channel.add_on_cancel_callback",
                          mq_common_callback_wrapper)
    wrap_function_wrapper(module, "Channel.add_on_close_callback",
                          mq_common_callback_wrapper)
    wrap_function_wrapper(module, "Channel.add_on_return_callback",
                          mq_common_callback_wrapper)
Пример #4
0
def wrap_external_trace(module,
                        object_path,
                        library,
                        url,
                        params=None,
                        exception_wrapper=None):
    wrap_object(module, object_path, external_trace_wrapper,
                (library, url, params, exception_wrapper))
Пример #5
0
def trace_uncaught_exception(module, object_path):
    """
    :param module:
    :param object_path:
    :return:
    """
    return wrap_object(module, object_path, uncaught_exception_wrapper)
def wrap_function_trace(module,
                        object_path,
                        name=None,
                        group=None,
                        label=None,
                        params=None):
    return wrap_object(module, object_path, function_trace_wrapper,
                       (name, group, label, params))
Пример #7
0
def trace_middleware_wrapper(module, object_path):
    """embed the middleware tracker to the django middleware
    :param module:
    :param object_path:
    :return:
    """
    return wrap_object(module, object_path, middleware_wrapper,
                       (middleware_wrapper_intermediary, ))
def wrap_mongo_trace(module, object_path, schema, method, server=None):
    wrap_object(module, object_path, mongo_trace_wrapper,
                (schema, method, server))
Пример #9
0
def trace_app_views(module, object_path):
    wrap_object(module, object_path, app_delegate_wrapper)
Пример #10
0
def wrap_error_trace(module, object_path, ignore_errors=None):
    wrap_object(module, object_path, error_trace_wrapper, (ignore_errors, ))
def wrap_memcache_trace(module, object_path, command, server=None):
    wrap_object(module, object_path, memcached_trace_wrapper,
                (server, command))
Пример #12
0
def wrap_redis_trace(module, object_path, command, server=None):
    wrap_object(module, object_path, redis_trace_wrapper, (command, server))