steffenvan commented on code in PR #1182:
URL: https://github.com/apache/jackrabbit-oak/pull/1182#discussion_r1385314065


##########
oak-run/src/test/java/org/apache/jackrabbit/oak/index/DocumentStoreIndexerIT.java:
##########
@@ -380,6 +387,95 @@ protected CompositeIndexer prepareIndexers(NodeStore 
nodeStore, NodeBuilder buil
 
     }
 
+    @Test
+    public void metrics() throws Exception {
+        MongoConnection mongoConnection = getConnection();
+        DocumentNodeStoreBuilder<?> docBuilder = builderProvider.newBuilder()
+                .setMongoDB(mongoConnection.getMongoClient(), 
mongoConnection.getDBName());
+        DocumentNodeStore store = docBuilder.build();
+
+        Whiteboard wb = new DefaultWhiteboard();
+        MongoDocumentStore ds = (MongoDocumentStore) 
docBuilder.getDocumentStore();
+        Registration r1 = wb.register(MongoDocumentStore.class, ds, 
emptyMap());
+
+        ScheduledExecutorService executor = 
Executors.newSingleThreadScheduledExecutor();
+        MetricStatisticsProvider metricsStatisticsProvider = new 
MetricStatisticsProvider(null, executor);
+        wb.register(StatisticsProvider.class, metricsStatisticsProvider, 
emptyMap());
+        Registration c1Registration = wb.register(MongoDatabase.class, 
mongoConnection.getDatabase(), emptyMap());
+
+        configureIndex(store);
+
+        NodeBuilder builder = store.getRoot().builder();
+        NodeBuilder appNB = newNode("app:Asset");
+        createChild(appNB,
+                "jcr:content",
+                "jcr:content/comments",
+                "jcr:content/metadata",
+                "jcr:content/metadata/xmp",
+                "jcr:content/renditions",
+                "jcr:content/renditions/original",
+                "jcr:content/renditions/original/jcr:content"
+        );
+        builder.child("test").setChildNode("book.jpg", appNB.getNodeState());
+        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+
+        String checkpoint = store.checkpoint(100000);
+
+        //Shut down this store and restart in readOnly mode
+        store.dispose();

Review Comment:
   Why is it necessary to call `dispose()` twice? Perhaps the test could be 
divided into 2? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to