You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2024/08/18 09:31:39 UTC
(jackrabbit-oak) branch trunk updated: OAK-11036: document-store: tune CacheWarmingTest - replace output to stdout by logger
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1d96203bfa OAK-11036: document-store: tune CacheWarmingTest - replace output to stdout by logger
1d96203bfa is described below
commit 1d96203bfafc56786ceff39983378836f6a36c68
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Sun Aug 18 10:31:24 2024 +0100
OAK-11036: document-store: tune CacheWarmingTest - replace output to stdout by logger
---
.../oak/plugins/document/prefetch/CacheWarmingTest.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
index 8ecac70c27..91b006bd0f 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
@@ -54,7 +54,8 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.guava.common.base.Stopwatch;
public class CacheWarmingTest {
@@ -68,6 +69,8 @@ public class CacheWarmingTest {
@Rule
public MongoConnectionFactory connectionFactory = new MongoConnectionFactory();
+ private static Logger LOG = LoggerFactory.getLogger(CacheWarmingTest.class);
+
private @Nullable MongoConnection mongoConnection;
private CountingMongoDatabase db;
@@ -170,7 +173,7 @@ public class CacheWarmingTest {
private void doSimple(boolean cleanCaches, boolean prefetch)
throws InterruptedException, CommitFailedException {
- System.out.println("=== doSimple( cleanCaches = " + cleanCaches + ", prefetch = " + prefetch + " )");
+ LOG.info("=== doSimple( cleanCaches = " + cleanCaches + ", prefetch = " + prefetch + " )");
Stopwatch sw = Stopwatch.createStarted();
DocumentStore ds = newMongoDocumentStore();
final CountingDocumentStore cds = new CountingDocumentStore(ds);
@@ -233,7 +236,7 @@ public class CacheWarmingTest {
private void logAndReset(String context,
CountingDocumentStore cds,
Stopwatch sw) {
- System.out.println(context
+ LOG.info(context
+ " -> createOrUpdateCalls = " + cds.getNumCreateOrUpdateCalls(Collection.NODES)
+ ", findCalls = " + cds.getNumFindCalls(Collection.NODES)
+ ", queryCalls = " + cds.getNumQueryCalls(Collection.NODES)