Report long running invokers if we're tracking their run duration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2808 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: Invoker.java,v 1.10 2003/08/18 21:38:07 mdb Exp $
|
// $Id: Invoker.java,v 1.11 2003/09/24 17:10:49 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.presents.util;
|
package com.threerings.presents.util;
|
||||||
|
|
||||||
@@ -134,13 +134,18 @@ public class Invoker extends LoopingThread
|
|||||||
if (PERF_TRACK) {
|
if (PERF_TRACK) {
|
||||||
long duration = System.currentTimeMillis() - start;
|
long duration = System.currentTimeMillis() - start;
|
||||||
Object key = unit.getClass();
|
Object key = unit.getClass();
|
||||||
|
|
||||||
Histogram histo = (Histogram)_tracker.get(key);
|
Histogram histo = (Histogram)_tracker.get(key);
|
||||||
if (histo == null) {
|
if (histo == null) {
|
||||||
// track in buckets of 50ms up to 500ms
|
// track in buckets of 50ms up to 500ms
|
||||||
_tracker.put(key, histo = new Histogram(0, 50, 10));
|
_tracker.put(key, histo = new Histogram(0, 50, 10));
|
||||||
}
|
}
|
||||||
histo.addValue((int)duration);
|
histo.addValue((int)duration);
|
||||||
|
|
||||||
|
// report long runners
|
||||||
|
if (duration > 500L) {
|
||||||
|
Log.warning("Invoker unit ran long [class=" + key +
|
||||||
|
", duration=" + duration + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user