From d30119eb65d1bbc9599430c9c7c82826a24fdb87 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 8 Aug 2005 23:54:41 +0000 Subject: [PATCH] Do some jiggery pokery to better classify the zillions of Interval$Unit$1 runnables that get added to the dobjmgr queue. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3675 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/server/PresentsDObjectMgr.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java index 90fc1ed78..6b41cafc4 100644 --- a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java +++ b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java @@ -287,7 +287,17 @@ public class PresentsDObjectMgr if (_eventCount % UNIT_PROFILING_INTERVAL == 0) { // record the time spent processing this unit - String cname = StringUtil.shortClassName(unit); + String cname; + // to more sensibly record non-event "units" we need to do + // some jiggery pokery + if (unit instanceof Runnable) { + cname = unit.toString(); + int laidx = cname.lastIndexOf("@"); + cname = (laidx == -1) ? cname : cname.substring(0, laidx); + cname = StringUtil.shortClassName(cname); + } else { + cname = StringUtil.shortClassName(unit); + } UnitProfile uprof = (UnitProfile)_profiles.get(cname); if (uprof == null) { _profiles.put(cname, uprof = new UnitProfile());