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
This commit is contained in:
Michael Bayne
2005-08-08 23:54:41 +00:00
parent ffec15fdd9
commit d30119eb65
@@ -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());