rishabhdaim commented on code in PR #2134:
URL: https://github.com/apache/jackrabbit-oak/pull/2134#discussion_r1978992655


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java:
##########
@@ -209,24 +208,19 @@ private Bson withIncludeExcludes(@NotNull Set<String> 
includes, @NotNull Set<Str
      * @param hint   the hint for the query, or null
      */
     private void logQueryExplain(String logMsg, @NotNull Bson query, Bson 
hint) {
-        final long timeSinceLastLog = System.currentTimeMillis() - 
lastExplainLogMs;
-        if (timeSinceLastLog < EXPLAIN_LOG_INTERVAL_MS) {
-            // then don't log
-            return;
-        }
-        final BasicDBObject explainResult = 
MongoUtils.explain(store.getDatabase(),
-                getNodeCollection(), query, hint);
-        final BasicDBObject winningPlan = 
MongoUtils.getWinningPlan(explainResult);
-        final BasicDBObject result = winningPlan == null ? explainResult : 
winningPlan;
-        if (LOG.isDebugEnabled()) {
-            // if log level is DEBUG, let's do a pretty print
-            String prettyPrinted = JsopBuilder.prettyPrint(result.toJson());
-            LOG.debug(logMsg, hint, prettyPrinted);
-        } else {
-            // otherwise let's just do a compact print
-            LOG.info(logMsg, hint, result);
+        if (LOG.isTraceEnabled()) {

Review Comment:
   I think we should call `logQueryExplain` itself from `isTraceEnabled` block.



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to