Skip to content
Snippets Groups Projects
Commit 39529a2f authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-1262: Remove confusing 'statistics' property and updated TimeIt documentation

parent 91c541fe
No related branches found
No related tags found
1 merge request!548L2SS-1262: Maintain statistics per object in TimeIt
......@@ -80,8 +80,8 @@ def fault_on_error():
def TimeIt(log_function=None, max_history_len=10):
"""
Wrapper to time calls, per object. Stores the timing log in a
<function>.statistics property as a dict with the following
Wrapper to time calls, per object ("self"). Stores the timing log in a
<function>.get_statistic(self) function returning a dict with the following
information:
"count": number of times the function was called
......@@ -128,9 +128,6 @@ def TimeIt(log_function=None, max_history_len=10):
# return function result (if any)
return result
# provide a way to access all collected statistics
timer_wrapper.statistics = statistics
# get the statistics for a specific object
timer_wrapper.get_statistic = lambda self: statistics.get(
self, default_statistic.copy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment