]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Add possibility to bookkeep barrier tracing with env var 39/4439/1
authorjsimomaa <jani.simomaa@gmail.com>
Thu, 10 Sep 2020 14:03:02 +0000 (17:03 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Thu, 10 Sep 2020 14:03:02 +0000 (17:03 +0300)
gitlab #5

Change-Id: Id063d21abd0a7ed58e2b2144a10ad9e8a48bb14e

bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java
bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/BarrierTracing.java

index f1e5b5cce10cc4758207a257c2f6cfeb4f0a3372..048d70b9f7046cf82c7306222098da041806436f 100644 (file)
@@ -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.");
index 68fdd824ed29f95eee0fa8f1cb0a49eb9dcebf92..3c9b7a011adf71ffa3e48d94293bd9673def5505 100644 (file)
@@ -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<SessionTask,Exception> tasks = new HashMap<>();