Include the longest elapsed time in the profile (not too useful if you profile
from the beginning, but useful if you clear the profiles in order to record over a brief interval). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6546 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -716,7 +716,7 @@ public class PresentsDObjectMgr
|
||||
if (uprof == null) {
|
||||
_profiles.put(cname, uprof = new UnitProfile());
|
||||
}
|
||||
uprof.record(start, elapsed);
|
||||
uprof.record(elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1030,10 +1030,11 @@ public class PresentsDObjectMgr
|
||||
* enabled. */
|
||||
protected static class UnitProfile
|
||||
{
|
||||
public void record (long start, long elapsed)
|
||||
public void record (long elapsed)
|
||||
{
|
||||
_totalElapsed += elapsed;
|
||||
_histo.addValue((int)elapsed);
|
||||
_longest = Math.max(elapsed, _longest);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1041,10 +1042,10 @@ public class PresentsDObjectMgr
|
||||
{
|
||||
int count = _histo.size();
|
||||
return _totalElapsed + "us/" + count + " = " + (_totalElapsed/count) + "us avg " +
|
||||
StringUtil.toString(_histo.getBuckets());
|
||||
StringUtil.toString(_histo.getBuckets() + " " + _longest + "us longest");
|
||||
}
|
||||
|
||||
protected long _totalElapsed;
|
||||
protected long _totalElapsed, _longest;
|
||||
protected Histogram _histo = new Histogram(0, 20000, 10);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user