From 0f6c6a46fc26be793e7d21f21b26574c32d1026f Mon Sep 17 00:00:00 2001 From: Sasha Date: Wed, 24 Apr 2013 17:05:00 +0100 Subject: [PATCH] better way to set stat collection time, but should be moved to Engine.*.properties --- .../compbio/stat/servlet/StatisticCollector.java | 29 ++++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) 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! "); } -- 1.7.10.2