From 906671790dd535b539558222052a28c4e81111f8 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Thu, 10 Sep 2020 17:03:02 +0300 Subject: [PATCH] Add possibility to bookkeep barrier tracing with env var gitlab #5 Change-Id: Id063d21abd0a7ed58e2b2144a10ad9e8a48bb14e --- .../src/org/simantics/db/impl/graph/AsyncBarrierImpl.java | 2 +- .../src/org/simantics/db/impl/graph/BarrierTracing.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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<>(); -- 2.47.1