Added setDefaultLongThreshold().

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2250 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2007-11-01 00:59:12 +00:00
parent b3d2950cc0
commit 539035f97b
+11 -2
View File
@@ -101,7 +101,7 @@ public class Invoker extends LoopingThread
*/ */
public long getLongThreshold () public long getLongThreshold ()
{ {
return DEFAULT_LONG_THRESHOLD; return _defaultLongThreshold;
} }
/** Returns the name of this invoker. */ /** Returns the name of this invoker. */
@@ -113,6 +113,15 @@ public class Invoker extends LoopingThread
protected String _name; protected String _name;
} }
/**
* Configures the default duration (in milliseconds) for an invoker unit to be reported as
* "long". Long units will result in a warning message written to the log.
*/
public static void setDefaultLongThreshold (long millis)
{
_defaultLongThreshold = millis;
}
/** /**
* Creates an invoker that will post results to the supplied result receiver. * Creates an invoker that will post results to the supplied result receiver.
*/ */
@@ -280,7 +289,7 @@ public class Invoker extends LoopingThread
protected int _unitsRun; protected int _unitsRun;
/** The duration of time after which we consider a unit to be delinquent and log a warning. */ /** The duration of time after which we consider a unit to be delinquent and log a warning. */
protected static final long DEFAULT_LONG_THRESHOLD = 500L; protected static long _defaultLongThreshold = 500L;
/** Whether or not to track invoker unit performance. */ /** Whether or not to track invoker unit performance. */
protected static final boolean PERF_TRACK = true; protected static final boolean PERF_TRACK = true;