diff options
author | Théo de la Hogue | 2024-07-23 16:12:51 +0200 |
---|---|---|
committer | Théo de la Hogue | 2024-07-23 16:12:51 +0200 |
commit | 07260c4f9335e15579fd5a2926cf37a58c5c7f05 (patch) | |
tree | 2cf410dd782bdf83f8b502c421a011339879e171 /src | |
parent | 4fa6a8edd44eac1e61f5b9ccd490770306a7d41f (diff) | |
download | argaze-07260c4f9335e15579fd5a2926cf37a58c5c7f05.zip argaze-07260c4f9335e15579fd5a2926cf37a58c5c7f05.tar.gz argaze-07260c4f9335e15579fd5a2926cf37a58c5c7f05.tar.bz2 argaze-07260c4f9335e15579fd5a2926cf37a58c5c7f05.tar.xz |
Fixing execution frequency calculation.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/DataFeatures.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/argaze/DataFeatures.py b/src/argaze/DataFeatures.py index 6711905..491d6ac 100644 --- a/src/argaze/DataFeatures.py +++ b/src/argaze/DataFeatures.py @@ -703,24 +703,21 @@ def PipelineStepExecutionTime(method): end = time.perf_counter() - # Create list to store method call dates + # Create list to store method call dates and init call frequency if method.__name__ not in self._execution_times.keys(): self._execution_times[method.__name__] = [] + self._execution_frequencies[method.__name__] = math.nan # Store start end end dates self._execution_times[method.__name__].append((start, end)) # Remove call dates older than 1 second and count number of calls to get frequency - if self._execution_times[method.__name__][-1][0] - self._execution_times[method.__name__][0][0] > 1: + while self._execution_times[method.__name__][-1][0] - self._execution_times[method.__name__][0][0] > 1: self._execution_times[method.__name__].pop(0) self._execution_frequencies[method.__name__] = len(self._execution_times[method.__name__]) - else: - - self._execution_frequencies[method.__name__] = math.nan - return result return wrapper |