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)
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_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)
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)
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)