From: Sasha Date: Wed, 24 Apr 2013 16:05:00 +0000 (+0100) Subject: better way to set stat collection time, but should be moved to Engine.*.properties X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0f6c6a46fc26be793e7d21f21b26574c32d1026f;p=jabaws.git better way to set stat collection time, but should be moved to Engine.*.properties --- diff --git a/webservices/compbio/stat/servlet/StatisticCollector.java b/webservices/compbio/stat/servlet/StatisticCollector.java index 91eed46..3a7d1bc 100644 --- a/webservices/compbio/stat/servlet/StatisticCollector.java +++ b/webservices/compbio/stat/servlet/StatisticCollector.java @@ -75,27 +75,26 @@ public class StatisticCollector implements ServletContextListener { executor = Executors.newScheduledThreadPool(2); if (collectClusterStats()) { + // collect statistics every minute. DEBUGGING ONLY!!! + long CollectingFrequency = 1; + // collect statistics every day. normal running... + //CollectingFrequency = 24 * 60; - ExecutionStatCollector clusterCollector = new ExecutionStatCollector( - clusterWorkDir, clusterMaxRuntime); - clustercf = executor.scheduleAtFixedRate(clusterCollector, 60, - 24 * 60, TimeUnit.MINUTES); - // clustercf = executor.scheduleAtFixedRate(clusterCollector, 15, - // 30, - // TimeUnit.SECONDS); + ExecutionStatCollector clusterCollector = new ExecutionStatCollector(clusterWorkDir, clusterMaxRuntime); + clustercf = executor.scheduleAtFixedRate(clusterCollector, 1, CollectingFrequency, TimeUnit.MINUTES); log.info("Collecting cluster statistics "); } else { log.info("Cluster statistics collector is disabled or not configured! "); } if (collectLocalStats()) { - ExecutionStatCollector localCollector = new ExecutionStatCollector( - localWorkDir, localMaxRuntime); - // localcf = executor.scheduleAtFixedRate(localCollector, 100, 60, - // TimeUnit.SECONDS); - - localcf = executor.scheduleAtFixedRate(localCollector, 10, 24 * 60, - TimeUnit.MINUTES); - log.info("Collecting local statistics "); + // collect statistics every minute. DEBUGGING ONLY!!! + long CollectingFrequency = 1; + // collect statistics every day. normal running... + //CollectingFrequency = 24 * 60; + + ExecutionStatCollector localCollector = new ExecutionStatCollector( localWorkDir, localMaxRuntime); + localcf = executor.scheduleAtFixedRate(localCollector, 1, CollectingFrequency, TimeUnit.MINUTES); + log.info("Collecting local statistics every " + CollectingFrequency + " minutes"); } else { log.info("Local statistics collector is disabled or not configured! "); }