[Swift-commit] r2510 - trunk/src/org/griphyn/vdl/karajan/lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Feb 6 20:59:27 CST 2009


Author: hategan
Date: 2009-02-06 20:59:26 -0600 (Fri, 06 Feb 2009)
New Revision: 2510

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
Log:
option to disable runtime stats

Modified: trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2009-02-07 02:57:40 UTC (rev 2509)
+++ trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2009-02-07 02:59:26 UTC (rev 2510)
@@ -1,17 +1,19 @@
 package org.griphyn.vdl.karajan.lib;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import org.globus.cog.karajan.arguments.Arg;
 import org.globus.cog.karajan.stack.VariableStack;
+import org.globus.cog.karajan.util.TypeUtil;
 import org.globus.cog.karajan.workflow.ExecutionException;
 import org.globus.cog.karajan.workflow.nodes.functions.FunctionsCollection;
-import org.globus.cog.karajan.util.TypeUtil;
+import org.griphyn.vdl.util.VDL2Config;
 
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-
 /** this is an icky class that does too much with globals, but is for
 proof of concept. */
 
@@ -87,13 +89,26 @@
 		List states = new ArrayList();
 
 		long lastDumpTime = 0;
+		private boolean disabled;
 
 		public ProgressTicker() {
 			super("Progress ticker");
+			try {
+                if ("true".equalsIgnoreCase(VDL2Config.getConfig().getProperty("ticker.disable"))) {
+                    logger.info("Ticker disabled in configuration file");
+                    disabled = true;
+                }
+            }
+            catch (IOException e) {
+                logger.debug("Could not read swift properties", e);
+            }
 		}
 
 		public void run() {
-			while(true) {
+		    if (disabled) {
+		        return;
+		    }
+		    while(true) {
 				dumpState();
 
 				try {
@@ -106,6 +121,9 @@
 		}
 
 		void dumpState() {
+		    if (disabled) {
+		        return;
+		    }
 			long now = System.currentTimeMillis();
 			if(lastDumpTime + MIN_PERIOD_MS > now) return;
 			lastDumpTime = now;
@@ -113,6 +131,9 @@
 		}
 
 		void finalDumpState() {
+		    if (disabled) {
+                return;
+            }
 			printStates("Final status: ");
 		}
 




More information about the Swift-commit mailing list