コード例 #1
0
def instrument_bmemcached_client(module):
    for name in _memcache_client_methods:
        if hasattr(module.Client, name):
            wrap_datastore_trace(module.Client,
                                 name,
                                 product='Memcached',
                                 target=None,
                                 operation=name)
コード例 #2
0
def instrument_solrpy(module):
    for name in _solrpy_client_methods:
        if hasattr(module.SolrConnection, name):
            wrap_datastore_trace(module.SolrConnection,
                                 name,
                                 product='Solr',
                                 target=None,
                                 operation=name)
コード例 #3
0
def instrument_pymongo_collection(module):
    def _collection_name(collection, *args, **kwargs):
        return collection.name

    for name in _pymongo_client_methods:
        if hasattr(module.Collection, name):
            wrap_datastore_trace(module.Collection, name, product='MongoDB',
                    target=_collection_name, operation=name)
コード例 #4
0
def instrument_pymongo_collection(module):
    def _collection_name(collection, *args, **kwargs):
        return collection.name

    for name in _pymongo_client_methods:
        if hasattr(module.Collection, name):
            wrap_datastore_trace(module.Collection,
                                 name,
                                 product='MongoDB',
                                 target=_collection_name,
                                 operation=name)
def instrument_pysolr(module):
    for name in _pysolr_client_methods:
        if hasattr(module.Solr, name):
            wrap_datastore_trace(module.Solr, name,
                    product='Solr', target=None, operation=name)

    if hasattr(module, 'SolrCoreAdmin'):
        for name in _pysolr_admin_methods:
            if hasattr(module.SolrCoreAdmin, name):
                wrap_datastore_trace(module.SolrCoreAdmin, name,
                        product='Solr', target=None,
                        operation='admin.%s' % name)
コード例 #6
0
def instrument_memcache(module):
    wrap_function_wrapper(module.Client, '_get_server', _nr_get_server_wrapper)

    for name in _memcache_client_methods:
        if hasattr(module.Client, name):
            wrap_memcache_single(module, name,
                    product='Memcached', target=None, operation=name)

    for name in _memcache_multi_methods:
        if hasattr(module.Client, name):
            wrap_datastore_trace(module.Client, name,
                    product='Memcached', target=None, operation=name)
コード例 #7
0
def instrument_redis_client(module):
    if hasattr(module, 'StrictRedis'):
        for name in _redis_client_methods:
            if name in vars(module.StrictRedis):
                wrap_datastore_trace(module.StrictRedis, name,
                        product='Redis', target=None, operation=name)

    if hasattr(module, 'Redis'):
        for name in _redis_client_methods:
            if name in vars(module.Redis):
                wrap_datastore_trace(module.Redis, name,
                        product='Redis', target=None, operation=name)
コード例 #8
0
def instrument_pysolr(module):
    for name in _pysolr_client_methods:
        if hasattr(module.Solr, name):
            wrap_datastore_trace(module.Solr,
                                 name,
                                 product='Solr',
                                 target=None,
                                 operation=name)

    if hasattr(module, 'SolrCoreAdmin'):
        for name in _pysolr_admin_methods:
            if hasattr(module.SolrCoreAdmin, name):
                wrap_datastore_trace(module.SolrCoreAdmin,
                                     name,
                                     product='Solr',
                                     target=None,
                                     operation='admin.%s' % name)
コード例 #9
0
def instrument_redis_client(module):
    if hasattr(module, 'StrictRedis'):
        for name in _redis_client_methods:
            if name in vars(module.StrictRedis):
                wrap_datastore_trace(module.StrictRedis,
                                     name,
                                     product='Redis',
                                     target=None,
                                     operation=name)

    if hasattr(module, 'Redis'):
        for name in _redis_client_methods:
            if name in vars(module.Redis):
                wrap_datastore_trace(module.Redis,
                                     name,
                                     product='Redis',
                                     target=None,
                                     operation=name)
コード例 #10
0
def instrument_pymemcache_client(module):
    for name in _memcache_client_methods:
        if hasattr(module.Client, name):
            wrap_datastore_trace(module.Client, name,
                    product='Memcached', target=None, operation=name)
コード例 #11
0
def instrument_solrpy(module):
    for name in _solrpy_client_methods:
        if hasattr(module.SolrConnection, name):
            wrap_datastore_trace(module.SolrConnection, name,
                    product='Solr', target=None, operation=name)