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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
c9cecece
Commit
c9cecece
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-244
: Include fail safe if packets are unparsable for a reason we didnt know about yet
parent
d9594ecd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
L2SS-244: Expose the SSTs in MPs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/clients/sst_client.py
+34
-27
34 additions, 27 deletions
devices/clients/sst_client.py
with
34 additions
and
27 deletions
devices/clients/sst_client.py
+
34
−
27
View file @
c9cecece
...
...
@@ -188,11 +188,12 @@ class SST_collector(Thread):
self
.
last_packet
=
self
.
queue
.
get
()
if
self
.
last_packet
is
None
:
logging
.
info
(
"
shutting down SST thread
"
)
break
self
.
process_packet
(
self
.
last_packet
)
logging
.
info
(
"
shutting down SST thread
"
)
def
join
(
self
,
timeout
=
0
):
logging
.
info
(
"
sending shutdown to SST thread
"
)
self
.
queue
.
put
(
None
)
...
...
@@ -205,31 +206,37 @@ class SST_collector(Thread):
self
.
parameters
[
"
queue_fill_percentage
"
]
=
numpy
.
double
(
100
*
self
.
queue
.
qsize
()
/
self
.
queue
.
maxsize
if
self
.
queue
.
maxsize
else
0
)
try
:
fields
=
StatisticsPacket
(
packet
)
except
ValueError
:
# could not parse header
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
if
fields
.
marker
!=
'
S
'
:
# packet is not SST
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
input_index
=
fields
.
sst_signal_input_index
try
:
fields
=
StatisticsPacket
(
packet
)
except
ValueError
:
# could not parse header
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
if
fields
.
marker
!=
'
S
'
:
# packet is not SST
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
input_index
=
fields
.
sst_signal_input_index
if
input_index
>=
self
.
MAX_INPUTS
:
# packet describes an input that is out of bounds for us
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
if
fields
.
payload_error
:
# cannot trust the data if a payload error is reported
self
.
parameters
[
"
nof_payload_errors
"
][
input_index
]
+=
numpy
.
uint64
(
1
)
return
# process the packet
self
.
parameters
[
"
nof_valid_packets
"
][
input_index
]
+=
numpy
.
uint64
(
1
)
self
.
parameters
[
"
last_values
"
][
input_index
][:
fields
.
nof_statistics_per_packet
]
=
fields
.
payload_sst
self
.
parameters
[
"
last_timestamps
"
][
input_index
]
=
numpy
.
float64
(
fields
.
timestamp
().
timestamp
())
self
.
parameters
[
"
integration_intervals
"
][
input_index
]
=
fields
.
integration_interval
()
except
Exception
as
e
:
# This is unexpected, so print a stack trace
logging
.
exception
(
"
Could not parse UDP packet
"
)
if
input_index
>=
self
.
MAX_INPUTS
:
# packet describes an input that is out of bounds for us
self
.
parameters
[
"
nof_invalid_packets
"
]
+=
numpy
.
uint64
(
1
)
return
if
fields
.
payload_error
:
# cannot trust the data if a payload error is reported
self
.
parameters
[
"
nof_payload_errors
"
][
input_index
]
+=
numpy
.
uint64
(
1
)
return
# process the packet
self
.
parameters
[
"
nof_valid_packets
"
][
input_index
]
+=
numpy
.
uint64
(
1
)
self
.
parameters
[
"
last_values
"
][
input_index
][:
fields
.
nof_statistics_per_packet
]
=
fields
.
payload_sst
self
.
parameters
[
"
last_timestamps
"
][
input_index
]
=
numpy
.
float64
(
fields
.
timestamp
().
timestamp
())
self
.
parameters
[
"
integration_intervals
"
][
input_index
]
=
fields
.
integration_interval
()
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