better way to set stat collection time, but should be moved to Engine.*.properties
authorSasha <asherstnev@main-laptop2>
Wed, 24 Apr 2013 16:05:00 +0000 (17:05 +0100)
committerSasha <asherstnev@main-laptop2>
Wed, 24 Apr 2013 16:05:00 +0000 (17:05 +0100)
webservices/compbio/stat/servlet/StatisticCollector.java

index 91eed46..3a7d1bc 100644 (file)
@@ -75,27 +75,26 @@ public class StatisticCollector implements ServletContextListener {
                executor = Executors.newScheduledThreadPool(2);\r
 \r
                if (collectClusterStats()) {\r
+                       // collect statistics every minute. DEBUGGING ONLY!!!\r
+                       long CollectingFrequency = 1;\r
+                       // collect statistics every day. normal running... \r
+                       //CollectingFrequency = 24 * 60;\r
 \r
-                       ExecutionStatCollector clusterCollector = new ExecutionStatCollector(\r
-                                       clusterWorkDir, clusterMaxRuntime);\r
-                       clustercf = executor.scheduleAtFixedRate(clusterCollector, 60,\r
-                                       24 * 60, TimeUnit.MINUTES);\r
-                       // clustercf = executor.scheduleAtFixedRate(clusterCollector, 15,\r
-                       // 30,\r
-                       // TimeUnit.SECONDS);\r
+                       ExecutionStatCollector clusterCollector = new ExecutionStatCollector(clusterWorkDir, clusterMaxRuntime);\r
+                       clustercf = executor.scheduleAtFixedRate(clusterCollector, 1, CollectingFrequency, TimeUnit.MINUTES);\r
                        log.info("Collecting cluster statistics ");\r
                } else {\r
                        log.info("Cluster statistics collector is disabled or not configured! ");\r
                }\r
                if (collectLocalStats()) {\r
-                       ExecutionStatCollector localCollector = new ExecutionStatCollector(\r
-                                       localWorkDir, localMaxRuntime);\r
-                       // localcf = executor.scheduleAtFixedRate(localCollector, 100, 60,\r
-                       // TimeUnit.SECONDS);\r
-\r
-                       localcf = executor.scheduleAtFixedRate(localCollector, 10, 24 * 60,\r
-                                       TimeUnit.MINUTES);\r
-                       log.info("Collecting local statistics ");\r
+                       // collect statistics every minute. DEBUGGING ONLY!!!\r
+                       long CollectingFrequency = 1;\r
+                       // collect statistics every day. normal running... \r
+                       //CollectingFrequency = 24 * 60;\r
+\r
+                       ExecutionStatCollector localCollector = new ExecutionStatCollector(     localWorkDir, localMaxRuntime);\r
+                       localcf = executor.scheduleAtFixedRate(localCollector, 1, CollectingFrequency, TimeUnit.MINUTES);\r
+                       log.info("Collecting local statistics every " + CollectingFrequency + " minutes");\r
                } else {\r
                        log.info("Local statistics collector is disabled or not configured! ");\r
                }\r