prevent false positives caused by zero-duration profiles

This commit is contained in:
Darren Ranalli 2008-10-21 02:23:01 +00:00
parent 54c51cba47
commit 158e726dc7
1 changed files with 6 additions and 1 deletions

View File

@ -46,8 +46,13 @@ class TaskTracker:
self.notify.info(s)
return isSpike
def addProfileSession(self, session):
isSpike = self._checkSpike(session)
duration = session.getDuration()
if duration == 0.:
# profiled code was too fast for the clock, throw this result out
# if we keep it we may get many false positive spike detects
return
isSpike = self._checkSpike(session)
self._durationAverager.addValue(duration)
storeAvg = True