From fe588b291bc540beb98a385b9863c9237dcad3c9 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 24 Sep 2003 17:10:49 +0000 Subject: [PATCH] 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 --- src/java/com/threerings/presents/util/Invoker.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/presents/util/Invoker.java b/src/java/com/threerings/presents/util/Invoker.java index a499af7ea..07042f0b6 100644 --- a/src/java/com/threerings/presents/util/Invoker.java +++ b/src/java/com/threerings/presents/util/Invoker.java @@ -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; @@ -134,13 +134,18 @@ public class Invoker extends LoopingThread if (PERF_TRACK) { long duration = System.currentTimeMillis() - start; Object key = unit.getClass(); - Histogram histo = (Histogram)_tracker.get(key); if (histo == null) { // track in buckets of 50ms up to 500ms _tracker.put(key, histo = new Histogram(0, 50, 10)); } histo.addValue((int)duration); + + // report long runners + if (duration > 500L) { + Log.warning("Invoker unit ran long [class=" + key + + ", duration=" + duration + "]."); + } } } catch (Exception e) {