Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
39529a2f
Commit
39529a2f
authored
2 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-1262
: Remove confusing 'statistics' property and updated TimeIt documentation
parent
91c541fe
No related branches found
No related tags found
1 merge request
!548
L2SS-1262: Maintain statistics per object in TimeIt
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/device_decorators.py
+2
-5
2 additions, 5 deletions
...ncontrol/tangostationcontrol/devices/device_decorators.py
with
2 additions
and
5 deletions
tangostationcontrol/tangostationcontrol/devices/device_decorators.py
+
2
−
5
View file @
39529a2f
...
...
@@ -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>.statistic
s 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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment