use of org.apache.sling.nosql.generic.adapter.MetricsNoSqlAdapterWrapper in project sling by apache.
the class CouchbaseNoSqlResourceProviderFactory method activate.
@Activate
private void activate(ComponentContext componentContext, Map<String, Object> config) {
String cacheKeyPrefix = PropertiesUtil.toString(config.get(CACHE_KEY_PREFIX_PROPERTY), CACHE_KEY_PREFIX_DEFAULT);
NoSqlAdapter couchbaseAdapter = new CouchbaseNoSqlAdapter(couchbaseClient, cacheKeyPrefix);
// enable call logging and metrics for {@link CouchbaseNoSqlAdapter}
noSqlAdapter = new MetricsNoSqlAdapterWrapper(couchbaseAdapter, LoggerFactory.getLogger(CouchbaseNoSqlAdapter.class));
}
use of org.apache.sling.nosql.generic.adapter.MetricsNoSqlAdapterWrapper in project sling by apache.
the class MongoDBNoSqlResourceProviderFactory method activate.
@Activate
private void activate(ComponentContext componentContext, Map<String, Object> config) {
String connectionString = PropertiesUtil.toString(config.get(CONNECTION_STRING_PROPERTY), CONNECTION_STRING_DEFAULT);
String database = PropertiesUtil.toString(config.get(DATABASE_PROPERTY), DATABASE_DEFAULT);
String collection = PropertiesUtil.toString(config.get(COLLECTION_PROPERTY), COLLECTION_DEFAULT);
mongoClient = new MongoClient(connectionString);
NoSqlAdapter mongodbAdapter = new MongoDBNoSqlAdapter(mongoClient, database, collection);
// enable call logging and metrics for {@link MongoDBNoSqlAdapter}
noSqlAdapter = new MetricsNoSqlAdapterWrapper(mongodbAdapter, LoggerFactory.getLogger(MongoDBNoSqlAdapter.class));
}
Aggregations