From: jsimomaa Date: Thu, 10 Sep 2020 14:03:02 +0000 (+0300) Subject: Add possibility to bookkeep barrier tracing with env var X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F4439%2F1;p=simantics%2Fplatform.git Add possibility to bookkeep barrier tracing with env var gitlab #5 Change-Id: Id063d21abd0a7ed58e2b2144a10ad9e8a48bb14e --- diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java index f1e5b5cce..048d70b9f 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java @@ -166,7 +166,7 @@ public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrier { } if(waitCount > WAIT_TIME) { - System.err.println("AsyncBarrierImpl.waitBarrier(" + LOGGER.warn("AsyncBarrierImpl.waitBarrier(" + request + ") is taking long to execute, so far " + (waitCount / 1000) + " s."); diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/BarrierTracing.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/BarrierTracing.java index 68fdd824e..3c9b7a011 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/BarrierTracing.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/BarrierTracing.java @@ -11,7 +11,12 @@ import org.simantics.db.impl.query.QueryProcessor.SessionTask; public class BarrierTracing { - public static final boolean BOOKKEEPING = false; + private static final String KEY = "SIMANTICS_DB_IMPL_BARRIER_TRACING"; + + public static final boolean BOOKKEEPING = Boolean.parseBoolean( + System.getProperty("org.simantics.db.impl.barrierTracing", + System.getenv(KEY) != null ? System.getenv(KEY) : "false") + ); static final boolean RESTART_GUARD = BOOKKEEPING && false; public static Map tasks = new HashMap<>();