From 047ef1f12a2c7e5146b0c5a99a24ca17ab6778ca Mon Sep 17 00:00:00 2001 From: bryan31 Date: Sun, 25 Oct 2020 23:59:00 +0800 Subject: [PATCH] =?UTF-8?q?enhancement:=20#I1X83P=20=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=80=E5=A5=BD=E8=83=BD=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E5=BC=80=E5=85=B3=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E5=AF=B9=E6=97=A5=E5=BF=97=E5=90=AF=E7=94=A8=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yomahub/liteflow/monitor/MonitorBus.java | 8 ++++++++ .../src/main/resources/applicationContext.xml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java b/liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java index a37039a4b..6eab35a23 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/monitor/MonitorBus.java @@ -43,6 +43,14 @@ public class MonitorBus { private ConcurrentHashMap> statisticsMap = new ConcurrentHashMap>(); + public MonitorBus(boolean enableMonitorLog) { + this.enableMonitorLog = enableMonitorLog; + if(this.enableMonitorLog){ + Timer timer = new Timer(); + timer.schedule(new MonitorTimeTask(this), this.getDelay(), this.getPeriod()); + } + } + public MonitorBus(boolean enableMonitorLog, int queueLimit, long delay, long period) { this.enableMonitorLog = enableMonitorLog; this.queueLimit = queueLimit; diff --git a/liteflow-test-spring/src/main/resources/applicationContext.xml b/liteflow-test-spring/src/main/resources/applicationContext.xml index 4a1ba551c..473b44df8 100644 --- a/liteflow-test-spring/src/main/resources/applicationContext.xml +++ b/liteflow-test-spring/src/main/resources/applicationContext.xml @@ -19,4 +19,8 @@ + + + +