Skip to content
GitLab
Explore
Sign in
Register
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
d84b6609
Commit
d84b6609
authored
Mar 18, 2022
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-659
: cleaning code
parent
7c150511
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!273
Resolve L2SS-659 "Compute archiving load"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
+8
-7
8 additions, 7 deletions
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
with
8 additions
and
7 deletions
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
+
8
−
7
View file @
d84b6609
...
...
@@ -239,7 +239,7 @@ class Archiver():
else
:
raise
def
add_attributes_by_device
(
self
,
device_name
,
global_archive_period
:
int
=
None
,
global_abs_change
:
int
=
None
,
def
add_attributes_by_device
(
self
,
device_name
,
global_archive_period
:
int
=
None
,
global_abs_change
:
int
=
1
,
global_rel_change
:
int
=
None
,
es_name
:
str
=
None
,
exclude
:
list
=
None
):
"""
Add sequentially all the attributes of the selected device in the event subscriber list, if not already present
...
...
@@ -252,18 +252,19 @@ class Archiver():
exclude
=
[]
d
=
DeviceProxy
(
device_fqdn
(
device_name
))
dev_attrs_list
=
d
.
get_attribute_list
()
device_attrs_list
=
d
.
get_attribute_list
()
# Filter out the attributes in exclude-list
exclude_list
=
[
a
.
lower
()
for
a
in
exclude
]
attrs_list
=
[
a
.
lower
()
for
a
in
list
(
dev_attrs_list
)
if
a
.
lower
()
not
in
exclude_list
]
# transform list for string comparison
attrs_list
=
[
a
.
lower
()
for
a
in
list
(
dev
ice
_attrs_list
)
if
a
.
lower
()
not
in
exclude_list
]
# transform list for string comparison
for
a
in
attrs_list
:
attr_fullname
=
attribute_fqdn
(
f
"
{
device_name
}
/
{
a
}
"
)
attr_proxy
=
AttributeProxy
(
attr_fullname
)
if
attr_proxy
.
is_polled
()
and
not
self
.
is_attribute_archived
(
attr_fullname
):
# if not polled attribute is also not archived
if
attr_proxy
.
is_polled
()
and
not
self
.
is_attribute_archived
(
attr_fullname
):
# if not polled
,
attribute is also not archived
try
:
es
=
DeviceProxy
(
es_name
or
self
.
get_next_subscriber
())
# choose an e.s. or get the first one available
polling_period
=
attr_proxy
.
get_poll_period
()
or
self
.
dev
_polling_time
archive_period
=
global_archive_period
or
int
(
attr_proxy
.
get_property
(
'
archive_period
'
)[
'
archive_period
'
][
0
])
or
self
.
dev_archive_period
abs_change
=
global_abs_change
or
1
polling_period
=
attr_proxy
.
get_poll_period
()
or
self
.
prod
_polling_time
archive_period
=
global_archive_period
or
int
(
attr_proxy
.
get_property
(
'
archive_period
'
)[
'
archive_period
'
][
0
])
abs_change
=
global_abs_change
rel_change
=
global_rel_change
self
.
add_attribute_to_archiver
(
attr_fullname
,
polling_period
=
polling_period
,
archive_event_period
=
archive_period
,
abs_change
=
abs_change
,
rel_change
=
rel_change
,
es_name
=
es
.
name
())
...
...
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