From a10f7a2b8c7d55afb668495d4947b1babffd8435 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Tue, 18 Nov 2008 23:01:53 +0000 Subject: [PATCH] added ~aitaskspikethreshold/~taskspikethreshold --- direct/src/task/TaskProfiler.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/direct/src/task/TaskProfiler.py b/direct/src/task/TaskProfiler.py index 470beacaa4..f36df40085 100755 --- a/direct/src/task/TaskProfiler.py +++ b/direct/src/task/TaskProfiler.py @@ -15,7 +15,7 @@ class TaskTracker: # number of samples required before spikes start getting identified TaskTracker.MinSamples = config.GetInt('profile-task-spike-min-samples', 30) # defines spike as longer than this multiple of avg task duration - TaskTracker.SpikeThreshold = config.GetFloat('profile-task-spike-threshold', 10.) + TaskTracker.SpikeThreshold = TaskProfiler.GetDefaultSpikeThreshold() def destroy(self): self.flush() del self._namePrefix @@ -103,6 +103,17 @@ class TaskProfiler: tracker.destroy() del self._namePrefix2tracker del self._task + + @staticmethod + def GetDefaultSpikeThreshold(): + return config.GetFloat('profile-task-spike-threshold', 10.) + + @staticmethod + def SetSpikeThreshold(spikeThreshold): + TaskTracker.SpikeThreshold = spikeThreshold + @staticmethod + def GetSpikeThreshold(): + return TaskTracker.SpikeThreshold def logProfiles(self, name=None): if name: